ICEfaces
  1. ICEfaces
  2. ICE-6860

Refactor node lookup in animation Javascript code

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.0, 2.0.1, EE-2.0.0.GA
    • Fix Version/s: 2.1-Beta, 3.0, EE-2.0.0.GA_P01
    • Component/s: ACE-Components
    • Labels:
      None
    • Environment:
      any

      Description

      Motivated by portlets support, the default Y.one() function was overridden to escape ':'s in the IDs passed to it. This didn't completely work in some cases, and it could cause problems if IDs are escaped again at different points in the code. A better approach would be to get the DOM elements via document.getElementById() and pass the element to Y.one() to avoid problems with IDs that contain ':'s. This practice needs to be consistent throughout the animation code to make the code less confusing and less error-prone.

        Activity

        Arturo Zambrano created issue -
        Arturo Zambrano made changes -
        Field Original Value New Value
        Assignee Arturo Zambrano [ artzambrano ]
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #24574 Fri May 13 17:06:42 MDT 2011 art.zambrano ICE-6860 Refactor node lookup in animation Javascript code
        Files Changed
        Commit graph MODIFY /icefaces2/branches/icefaces-2.0.x-maintenance/icefaces/ace/component/resources/org.icefaces.component.util/component.js
        Commit graph MODIFY /icefaces2/branches/icefaces-2.0.x-maintenance/icefaces/ace/component/resources/org.icefaces.component.animation/animation.js
        Hide
        Arturo Zambrano added a comment -

        The reasons why the original approach to escaping ':'s in IDs wasn't having the desired effect were that, in Javascript, String.replace() only replaces the first occurrence of the substring, so it was necessary to use a regex with the global modifier instead to replace all occurrences. The other reason was that the code that overrides the default Y.one() function to support ':'s in ID's stopped having an effect after a previous refactoring related to reducing calls to ice.yui3.use(). This code was moved to a more appropriate place, just after loading the required dependencies. Thus, we'll keep using Y.one() directly without first using document.getelementById(), since now things work as desired.

        Committed fix to 2.0 maintenance branch to revision 24574.

        Show
        Arturo Zambrano added a comment - The reasons why the original approach to escaping ':'s in IDs wasn't having the desired effect were that, in Javascript, String.replace() only replaces the first occurrence of the substring, so it was necessary to use a regex with the global modifier instead to replace all occurrences. The other reason was that the code that overrides the default Y.one() function to support ':'s in ID's stopped having an effect after a previous refactoring related to reducing calls to ice.yui3.use(). This code was moved to a more appropriate place, just after loading the required dependencies. Thus, we'll keep using Y.one() directly without first using document.getelementById(), since now things work as desired. Committed fix to 2.0 maintenance branch to revision 24574.
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #24581 Mon May 16 12:09:03 MDT 2011 art.zambrano ICE-6860 Refactor node lookup in animation Javascript code (2.0 trunk)
        Files Changed
        Commit graph MODIFY /icefaces2/trunk/icefaces/ace/component/resources/org.icefaces.component.util/component.js
        Commit graph MODIFY /icefaces2/trunk/icefaces/ace/component/resources/org.icefaces.component.animation/animation.js
        Arturo Zambrano made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Ken Fyten made changes -
        Salesforce Case []
        Fix Version/s EE-2.0.0.GA_P01 [ 10271 ]
        Fix Version/s 2.1 [ 10241 ]
        Ken Fyten made changes -
        Fix Version/s 2.1-Beta [ 10291 ]
        Fix Version/s 2.1 [ 10241 ]
        Ken Fyten made changes -
        Fix Version/s 3.0 [ 10241 ]
        Ken Fyten made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Arturo Zambrano
            Reporter:
            Arturo Zambrano
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: