Changes between Initial Version and Version 2 of Ticket #18495


Ignore:
Timestamp:
Dec 31, 2015, 12:03:49 PM (6 years ago)
Author:
dylan
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #18495

    • Property Owner changed from dante to dylan
    • Property Status changed from new to assigned
    • Property Milestone changed from tbd to 1.11
  • Ticket #18495 – Description

    initial v2  
    11In widget.Toaster.js if 0 is passed in for duration value the following evaluation will be run:
     2
     3{{{
    24duration = duration||this.duration;
     5}}}
    36
    47This will result in 0 being viewed as false and this.duration being used instead.  This means the only way to used the valid value of 0 was to have the default set to 0.  This seems like a design flaw because if most of your messages you want a default of some amount of time other then 0 you cannot make some messages like errors stay open with the value of 0.  If the code checked for undefined instead and only use this.default in the case of undefined it would be possible to use 0.
    58
    69Proposing swapping line 103:
     10{{{
    711duration = duration||this.duration;
     12}}}
    813to:
     14{{{
    915duration = duration == undefined ? this.duration : duration;
     16}}}