Skip to content

Commit

Permalink
_TemplatedMixin: remove support for templatePath etc., refs #4
Browse files Browse the repository at this point in the history
  • Loading branch information
wkeese committed Feb 2, 2013
1 parent 84321ae commit 136a334
Showing 1 changed file with 2 additions and 28 deletions.
30 changes: 2 additions & 28 deletions _TemplatedMixin.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
define([
"require",
"dojo/_base/array", // array.forEach
"dojo/cache", // dojo.cache
"dojo/_base/connect", // remove for 2.0
"dojo/_base/declare", // declare
"dojo/dom-construct", // domConstruct.destroy, domConstruct.toDom
"dojo/_base/lang", // lang.getObject
Expand All @@ -11,18 +9,16 @@ define([
"dojo/sniff", // has("ie")
"dojo/string", // string.substitute string.trim
"dojo/touch",
"dojo/_base/unload", // unload.addOnWindowUnload
"./_WidgetBase"
], function(require, array, cache, connect, declare, domConstruct, lang, mouse, on, has, string, touch, unload, _WidgetBase){
], function(require, array, declare, domConstruct, lang, mouse, on, has, string, touch, _WidgetBase){

// module:
// dijit/_TemplatedMixin

// Map from string name like "mouseenter" to synthetic event like mouse.enter
var synthEvents = lang.delegate(touch, {
"mouseenter": mouse.enter,
"mouseleave": mouse.leave,
"keypress": connect._keypress // remove for 2.0
"mouseleave": mouse.leave
});

// To be lightweight, _TemplatedMixin doesn't require() dijit/a11yclick.
Expand All @@ -39,11 +35,6 @@ define([
// Use in conjunction with dojo.cache() to load from a file.
templateString: null,

// templatePath: [protected deprecated] String
// Path to template (HTML file) for this widget relative to dojo.baseUrl.
// Deprecated: use templateString with require([... "dojo/text!..."], ...) instead
templatePath: null,

// skipNodeCache: [protected] Boolean
// If using a cached widget template nodes poses issues for a
// particular widget class, it can set this property to ensure
Expand Down Expand Up @@ -104,10 +95,6 @@ define([
// tags:
// protected

if(!this.templateString){
this.templateString = cache(this.templatePath, {sanitize: true});
}

// Lookup cached version of template, and download to cache if it
// isn't there already. Returns either a DomNode or a string, depending on
// whether or not the template contains ${foo} replacement parameters.
Expand Down Expand Up @@ -299,19 +286,6 @@ define([
}
};

if(has("ie")){
unload.addOnWindowUnload(function(){
var cache = _TemplatedMixin._templateCache;
for(var key in cache){
var value = cache[key];
if(typeof value == "object"){ // value is either a string or a DOM node template
domConstruct.destroy(value);
}
delete cache[key];
}
});
}

// These arguments can be specified for widgets which are used in templates.
// Since any widget can be specified as sub widgets in template, mix it
// into the base widget class. (This is a hack, but it's effective.).
Expand Down

0 comments on commit 136a334

Please sign in to comment.