Opened 7 years ago

Closed 7 years ago

#14282 closed defect (fixed)

Avatar.update() does not respect Source.generateText property

Reported by: Simon Speich Owned by: bill
Priority: high Milestone: 1.8
Component: DnD Version: 1.7.0
Keywords: Cc:
Blocked By: Blocking:

Description

Each dnd source has a generateText property which is set to true by default in Source.js line 100. When constructing the Avatar this property is checked before calling this._generateText() on line 51 in Avatar.js, but not when updating the avatar on line 110.

Quick fix in Avatar.js line 110:

node.innerHTML = this._generateText();

should be:

node.innerHTML = this.manager.source.generateText ? this._generateText() : ""

Note: If this get's fixed then dijit.tree.dndSource.js has to be fixed too, since it doesn't set this property and would not display the text anymore when dragging. Should I open a separate bug for that?

Change History (6)

comment:1 Changed 7 years ago by bill

So the bug is that when a dojo.dnd.Source sets generateText: false, it still generates the text? (I'm unclear what the text is, apparently just for example a (3) to indicate that three items are being dragged?)

Probably not worth opening a separate ticket for Tree, just need to add a

generateText: true

into dijit/tree/dndSource.html, right?

comment:2 in reply to:  1 Changed 7 years ago by Simon Speich

Replying to bill:

So the bug is that when a dojo.dnd.Source sets generateText: false, it still generates the text?

correct (as soon as update is called)

(I'm unclear what the text is, apparently just for example a (3) to indicate that three items are being dragged?)

correct, but I customized it to display 'Copy' or 'Move'. So it can be more than that.

Probably not worth opening a separate ticket for Tree, just need to add a

generateText: true

into dijit/tree/dndSource.html, right?

yep (in dijit/tree/dndSource.js)

comment:3 Changed 7 years ago by bill

Milestone: tbd

comment:4 Changed 7 years ago by Eugene Lazutkin

Component: DnDDijit
Owner: changed from Eugene Lazutkin to bill
Status: newassigned

It looks to me (indirectly) that this is a Dijit ticket.

comment:5 Changed 7 years ago by bill

Component: DijitDnD
Milestone: tbd1.8

it's more of a DnD bug but I'll check in the fix.

comment:6 Changed 7 years ago by bill

Resolution: fixed
Status: assignedclosed

In [28249]:

Fix update() method to obey source.generateText flag (specifically, when the flag is false). Fixes #14282 !strict.

Note: See TracTickets for help on using tickets.