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 Mar 8, 2013
1 parent 1df643b commit 4faf02a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 30 deletions.
10 changes: 4 additions & 6 deletions _AttachMixin.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,21 @@
define([
"require",
"dojo/_base/array", // array.forEach
"dojo/_base/connect", // remove for 2.0
"dojo/_base/declare", // declare
"dojo/_base/lang", // lang.getObject
"dojo/mouse",
"dojo/on",
"dojo/touch",
"./_WidgetBase"
], function(require, array, connect, declare, lang, mouse, on, touch, _WidgetBase){
], function(require, array, declare, lang, mouse, on, touch, _WidgetBase){

// module:
// dijit/_AttachMixin

// 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, _AttachMixin doesn't require() dijit/a11yclick.
Expand Down Expand Up @@ -134,7 +132,7 @@ define([

// Process data-dojo-attach-point
var _attachScope = this.attachScope || this,
attachPoint = getAttrFunc(baseNode, "dojoAttachPoint") || getAttrFunc(baseNode, "data-dojo-attach-point");
attachPoint = getAttrFunc(baseNode, "data-dojo-attach-point");
if(attachPoint){
var point, points = attachPoint.split(/\s*,\s*/);
while((point = points.shift())){
Expand All @@ -149,7 +147,7 @@ define([
}

// Process data-dojo-attach-event
var attachEvent = getAttrFunc(baseNode, "dojoAttachEvent") || getAttrFunc(baseNode, "data-dojo-attach-event");
var attachEvent = getAttrFunc(baseNode, "data-dojo-attach-event");
if(attachEvent){
// NOTE: we want to support attributes that have the form
// "domEvent: nativeEvent; ..."
Expand Down
25 changes: 1 addition & 24 deletions _TemplatedMixin.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
define([
"dojo/cache", // dojo.cache
"dojo/_base/declare", // declare
"dojo/dom-construct", // domConstruct.destroy, domConstruct.toDom
"dojo/_base/lang", // lang.getObject
"dojo/on",
"dojo/sniff", // has("ie")
"dojo/string", // string.substitute string.trim
"./_AttachMixin"
], function(cache, declare, domConstruct, lang, on, has, string, _AttachMixin){
], function(declare, domConstruct, lang, has, string, _AttachMixin){

// module:
// dijit/_TemplatedMixin
Expand All @@ -21,11 +20,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 @@ -73,10 +67,6 @@ define([
// protected

if(!this._rendered){
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 @@ -172,18 +162,5 @@ define([
}
};

if(has("ie")){
on(window, "unload", 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];
}
});
}

return _TemplatedMixin;
});

0 comments on commit 4faf02a

Please sign in to comment.