Opened 12 years ago

Closed 12 years ago

#4208 closed defect (fixed)

Dnd has dojo.lang reference

Reported by: guest Owned by: Eugene Lazutkin
Priority: high Milestone: 0.9
Component: DnD Version: 0.9
Keywords: Cc:
Blocked By: Blocking:

Description

In dojo/dnd/container.js, there's a reference to dojo.lang which doesn't exists in 0.9 that can cause issues:

dojo.dnd._defaultCreator = function(node){

summary: takes a container node, and returns an appropriate creator function node: Node: a container node var tag = node.tagName.toLowerCase(); var c = tag == "table" ? dojo.dnd._createTrTd : dojo.dnd._createNode(dojo.dnd._defaultCreatorNodes[tag]); var r = (dojo.lang && dojo.lang.repr) ? dojo.lang.repr : function(o){ return String(o); }; return function(item, hint){ Function

var isObj = dojo.isObject(item) && item; var data = (isObj && item.data) ? item.data : item; var type = (isObj && item.type) ? item.type : text?; var t = r(data), n = (hint == "avatar" ? dojo.dnd._createSpan : c)(t); n.id = dojo.dnd.getUniqueId(); return {node: n, data: data, type: type};

};

Should be : dojo.dnd._defaultCreator = function(node){

summary: takes a container node, and returns an appropriate creator function node: Node: a container node var tag = node.tagName.toLowerCase(); var c = tag == "table" ? dojo.dnd._createTrTd : dojo.dnd._createNode(dojo.dnd._defaultCreatorNodes[tag]); return function(item, hint){ Function

var isObj = dojo.isObject(item) && item; var data = (isObj && item.data) ? item.data : item; var type = (isObj && item.type) ? item.type : text?; var t = String(data), n = (hint == "avatar" ? dojo.dnd._createSpan : c)(t); n.id = dojo.dnd.getUniqueId(); return {node: n, data: data, type: type};

};

Change History (2)

comment:1 Changed 12 years ago by bill

Component: GeneralDnD
Owner: changed from anonymous to Eugene Lazutkin

comment:2 Changed 12 years ago by Eugene Lazutkin

Resolution: fixed
Status: newclosed

(In [10239]) Removed reference to dojo.lang.repr() --- it didn't harm, but we can save a few bytes by removing it. Thanks, guest! Fixes #4208.

Note: See TracTickets for help on using tickets.