silverstripe-framework/admin/javascript
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
..
jquery-changetracker MINORE: Remove training whitespace. 2016-01-07 10:15:54 +13:00
jquery-fitheighttoparent MINORE: Remove training whitespace. 2016-01-07 10:15:54 +13:00
lang Update translations 2016-08-15 15:49:50 +12:00
CMSSecurity.js API Enable re-authentication within the CMS if a user session is lost 2014-10-14 15:19:48 +13:00
leaktools.js MINORE: Remove training whitespace. 2016-01-07 10:15:54 +13:00
LeftAndMain.ActionTabSet.js FIX for #5683: Address security warning in CMS when attempting to access <iframe> contents (Back-porting fix from PR #5163) 2016-06-12 17:26:36 -07:00
LeftAndMain.BatchActions.js MINORE: Remove training whitespace. 2016-01-07 10:15:54 +13:00
LeftAndMain.Content.js MINORE: Remove training whitespace. 2016-01-07 10:15:54 +13:00
LeftAndMain.EditForm.js Merge branch '3.2' into 3.3 2016-06-13 12:29:45 +01:00
LeftAndMain.FieldDescriptionToggle.js Add toggleable description to CMS fields 2015-04-24 11:40:29 +12:00
LeftAndMain.FieldHelp.js BUG Fix several issues around onmatch/onunmatch entwines. 2014-07-17 14:14:52 +12:00
LeftAndMain.js Fixing button destroy bug 2016-09-15 08:23:22 +09:30
LeftAndMain.Layout.js MINORE: Remove training whitespace. 2016-01-07 10:15:54 +13:00
LeftAndMain.Menu.js Merge remote-tracking branch 'origin/3.3' into 3 2016-03-04 14:55:08 +13:00
LeftAndMain.Panel.js MINORE: Remove training whitespace. 2016-01-07 10:15:54 +13:00
LeftAndMain.Ping.js MINORE: Remove training whitespace. 2016-01-07 10:15:54 +13:00
LeftAndMain.Preview.js BUG Fix regression in url concatenation #4967 2016-08-15 16:49:57 +12:00
LeftAndMain.Tree.js Merge 3.3 into 3 2016-05-11 14:06:23 +12:00
LeftAndMain.TreeDropdownField.js FIX 7763 TreeDropdownField needs to refresh after CMS edit form save 2012-08-29 10:52:56 +12:00
lib.js MINORE: Remove training whitespace. 2016-01-07 10:15:54 +13:00
MemberDatetimeOptionsetField.js MINORE: Remove training whitespace. 2016-01-07 10:15:54 +13:00
MemberImportForm.js MINORE: Remove training whitespace. 2016-01-07 10:15:54 +13:00
ModelAdmin.js MINORE: Remove training whitespace. 2016-01-07 10:15:54 +13:00
SecurityAdmin.js MINORE: Remove training whitespace. 2016-01-07 10:15:54 +13:00
ssui.core.js MINORE: Remove training whitespace. 2016-01-07 10:15:54 +13:00