silverstripe-framework/admin
3Dgoo cd8904e045 Fixing button destroy bug
When you want to add a button to the CMS but don't want LeftAndMain to apply jQuery UI button to it we add the `data-button="true"` attribute to our button. 

The `onadd` function checks that this attribute does not exist before calling `this.button()`.

The `onremove` incorrectly checks that this attribute does exist before calling `this.button('destroy')`. This should be checking that this attribute does not exist, just like the `onadd` function.

What this causes is when you have a button with the `data-button` attribute a button is not created, but when you leave the page `destory` gets called on an item which doesn't exist. We end up with the following error:

> Uncaught Error: cannot call methods on button prior to initialization; attempted to call method 'destroy'

The other issue with this logic is buttons are never getting destroyed when `onremove` is called.

The whole issue is caused by a missing `!` in the if statement. This change adds it in to fix the problem.
2016-09-15 08:23:22 +09:30
..
code Merge 3.3 into 3.4 2016-08-05 16:48:26 +12:00
css BUG Fix missing icons 2016-07-04 18:09:22 +12:00
font Merge remote-tracking branch 'origin/3.3' into 3 2016-02-09 18:25:47 +13:00
images Update button and tab styles 2015-07-15 10:35:21 +12:00
javascript Fixing button destroy bug 2016-09-15 08:23:22 +09:30
scss BUG Fix missing icons 2016-07-04 18:09:22 +12:00
templates API refactor LeftAndMain_Menu.ss into individually overridable components 2016-03-15 09:34:39 -07:00
tests MINORE: Remove training whitespace. 2016-01-07 10:15:54 +13:00
thirdparty update cms notifications 2015-09-02 15:47:48 +12:00
_config.php Remove all redundant whitespace 2014-08-19 09:17:15 +12:00
.gitignore MINOR Removing executable flag from all files (thanks miiihi) 2011-09-18 22:04:02 +02:00
config.rb Update compass config 2015-07-09 10:11:00 +12:00