We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 15729
    • 4 Posts
    I need update mootools in Modx to 1.2.1, but I don’t know how to do that. When I replace by new mootool.js file, I can’t using drop-down menu and some function doesn’t work. Some body help me?

    Kevin!
      • 25663 MODX Staff
      • 12,272 Posts
      Which drop down menu and which functions don’t work?
        Ryan Thrash, MODX Co-Founder
        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
        • 5340
        • 1,624 Posts
        If I remember well the APIs from 1.1 are not compatible with 1.2.1.

        Is the 1.2.1 backwards compatible?
          • 17883
          • 1,039 Posts
          Is the 1.2.1 backwards compatible?

          No afaik.
            • 5340
            • 1,624 Posts
            At some point Mootools offered a 1.2.1 compatible with the 1.1.
            I couldn’t find it anymore on their website.

            Ask on the forums
              • 36416
              • 589 Posts
              Quote from: xpix at Nov 18, 2008, 09:01 AM

              At some point Mootools offered a 1.2.1 compatible with the 1.1.
              I couldn’t find it anymore on their website.

              Hm, never noticed... and I’m using 1.2 on several sites.
                • 30625
                • 19 Posts
                its not compatible:
                this is in the sample of modx, based on 1.1
                /**
                 * Light Menu System v0.1
                 * @author Jonathan Schemoul
                 * @copyright 2006-2007 Holdiland
                 * @license GPL V2 or newer
                 */
                var menuEffects = new Class({
                        initialize: function(selector, options) {
                                this.options = Object.extend({
                                        subElement: false,
                                        subElementSelector: 'a'
                                }, options || {})
                                this.selector = selector;
                                this.currTimer = 500;
                                $ES(selector + ' li ul').each(function(el) {
                                        el.setStyles({
                                                'display': 'block'
                                        });
                                        normalHeight = el.offsetHeight;
                                        el.setStyles({
                                                'height': 0,
                                                'overflow': 'hidden'
                                        });
                                        elParent = $(el.parentNode);
                                        
                                        currentMenu = new Fx.Style(el, 'height');
                                        elParent.addEvents({
                                                'mouseover': function(submenu, myParent, targetValue) {
                                                        myParent.addClass('hover');
                                                        submenu.clearTimer();
                                                        submenu.custom(targetValue);
                                                }.pass([currentMenu, elParent, normalHeight]),
                                                'mouseout': function(submenu, myParent, targetValue) {
                                                        myParent.removeClass('hover');
                                                        submenu.clearTimer();
                                                        submenu.custom(targetValue);
                                                }.pass([currentMenu, elParent, 0])
                                        })
                                }.bind(this));
                        }
                });
                function processMenuEffects (){
                        var myMenus = new menuEffects('#myajaxmenu', {
                                subElement: true
                        });
                }
                window.onDomReady(processMenuEffects);
                


                I try to make it work with 1.2.1 but no success
                first change the comrequest to

                //window.onDomReady(processMenuEffects);
                
                window.addEvent('domready', function processMenuEffects (){
                        var myMenus = new menuEffects('myajaxmenu', {
                                subElement: true
                        	});
                });
                


                then i get stuck...... does anyone use the menu on 1.2.1

                  no mail. no icq, no aim, no msn, no yim, no sms, no phone, no fax, no telex, no satellite.... just yell smiley
                  • 31724
                  • 24 Posts
                  Here is my updated code which works with mootools 1.2. Might be usefull as demo site in Revo is still using mootools 1.1.

                  /**
                   * Light Menu System v0.1
                   * @author Jonathan Schemoul
                   * @copyright 2006-2007 Holdiland
                   * @license GPL V2 or newer
                   * updated for Mootools 1.2 by Vlado Kundrat
                   */
                  var menuEffects = new Class({
                          initialize: function(selector, options) {
                                  this.options = Object.extend({
                                          subElement: false,
                                          subElementSelector: 'a'
                                  }, options || {})
                                  this.selector = selector;
                                  $$(selector + ' li ul').each(function(el) {
                                          
                  								el.setStyles({
                                                  'display': 'block'
                                          });
                                          normalHeight = el.offsetHeight;
                                          el.setStyles({
                                                  'height': 0,
                                                  'overflow': 'hidden'
                                          });
                                          elParent = $(el.parentNode); 
                                          
                                          el.set('tween', {duration: '200'} );
                                          
                                          elParent.addEvents({
                                                  'mouseover': function(el, myParent, targetValue) {
                                                          myParent.addClass('hover');
                                                          el.tween('height', targetValue);
                                                  }.pass([el, elParent, normalHeight]),
                                                  
                                                  'mouseout': function(el, myParent, targetValue) {
                                                          myParent.removeClass('hover');
                                                          el.tween('height', 0);
                                                  }.pass([el, elParent])
                                          })
                                  }.bind(this));
                          }
                  });
                  
                  window.addEvent('domready', function processMenuEffects (){
                       var myMenus = new menuEffects('#myajaxmenu', {
                               subElement: true
                       });
                  });
                  
                    • 25333
                    • 2 Posts
                    Thanks for the 1.2 convert - saved me some time wink
                    I just started doing it and was like - I cant be the only one!

                    Appreciate the help!
                      • 36426
                      • 197 Posts
                      Hi does anyone know the code for Evolution to work with mootools 1.2.1, currently after using the replacement code above my manager will not let me log in anymore...

                      Thanks for any help.
                        Yorkshire UK based hosting provider: https://www.simulant.uk