Opened 13 years ago

Closed 12 years ago

#750 closed defect (fixed)

Animation duration as String

Reported by: maulinpshah.public@… Owned by: anonymous
Priority: low Milestone: 0.9
Component: Widgets Version: 0.3
Keywords: Cc:
Blocked By: Blocking:

Description

lfx/Animation.js constructor checks if

dojo.lang.isNumber(handlers) on line 101.

problem is... tracing this way back, sometimes a string gets sent in of a number.

tracing the problem of where duration was set as a string:

  1. dojo.lfx.Animation
  2. lfx/html line 103: dojo.lfx.html.propertyAnimation var anim = new dojo.lfx.Animation(duration, curve, easing);
  3. lfx/html line 143: dojo.lfx.html.fadeIn
  4. HtmlWdget? line 77: this.toggleObj.show(this.domNode, this.toggleDuration, null,

dojo.lang.hitch(this, this.onShow), this.explodeSrc);

aha! when this.toggleDuration is set by markup, its not converted to a number...

so, i don't care where its fixed: always making toggleDuration convert to a number, or anywhere down the line, but it needs to be fixed somewhere. (my quick hack was to change isNumber to isNumeric in Animation.js, and in the isNumeric, us a Number() "cast").

i hope this makes sense. it was a huge blocker for me when trying to use Dialog.

Change History (4)

comment:1 Changed 13 years ago by maulinpshah.public@…

Priority: highlow
severity: majorminor

woops... now i see, it was not set as a string from markup... (markup seems to convert to number just fine). I was creating the widget on the fly, and i did not convert to a number.

i had: this.modal = dojo.widget.createWidget("dialog",

{ bgColor:"black",

bgOpacity:"0.3", toggle:"fade", toggleDuration:"250"

},

and changed it to:

this.modal = dojo.widget.createWidget("dialog",

{ bgColor:"black",

bgOpacity:"0.3", toggle:"fade", toggleDuration:250

},

and life is good again.

sorry. though it probably should still be fixed?

comment:2 Changed 13 years ago by bill

Milestone: 0.3.10.4

I know that this can be a frustrating bug to find, but I'm not sure whether or not it's a good idea to do type conversion for programmatic widget creation. Of course it's necessary for creating widgets via markup.

In any case, if we do fix this, it would be in the createWidget() call or some generic place that applies to all widgets, not something specific to lfx.

comment:3 Changed 13 years ago by dylan

Milestone: 0.40.5

comment:4 Changed 12 years ago by bill

Resolution: fixed
Status: newclosed

Fixed in 0.9. toggleDuration is only defined on certain widgets (like Dialog and Tooltip), and for those widgets declaring toggleDuration as a number in markup (like toggleDuration="100") should work.

Note: See TracTickets for help on using tickets.