0
Welcome Guest! Login
0 items Join Now

[Bug fix] Colorchooser elements not updating on preset load

    • evilC's Avatar
    • evilC
    • Jr. Rocketeer
    • Posts: 39
    • Thanks: 0

    [Bug fix] Colorchooser elements not updating on preset load

    Posted 13 years 6 months ago
    • This code is to fix the problem that when you click a preset to load it, the text box of colorchooser items change, but the colour does not change until you mouse over it.

      com_gantry/admin/elements/colorchooser.php

      around line 85

      find:
                     $('params".$name."').getParent().addEvents({
                          'mouseenter': f_".$name2.",
                          'mouseleave': function(){
                               this.removeEvent('mouseenter', f_".$name2.");
                          }
                     });

      replace with:
                     f_".$name2."();

      I have no idea why you would only want to init the object on mousein. This code changes it so when the widget is rendered, it is initialized.

      Tested and working in Quasar + Momentum.
    • evilC's Avatar
    • evilC
    • Jr. Rocketeer
    • Posts: 39
    • Thanks: 0

    Re: [Bug fix] Colorchooser elements not updating on preset load

    Posted 13 years 6 months ago
    • Another fix to this file:

      It does not fire the "change" event when you pick something new.

      You can add
                                    input.fireEvent('change');

      ...after lines 102 and 106 (If you add it after 102, it would then be after 107...)
      This will fix this and allow you to easily monitor a colorchooser included in a custom admin widget.

Time to create page: 0.059 seconds