mirror of
https://github.com/wintercms/winter.git
synced 2024-06-28 05:33:29 +02:00
Removing a component now removes the standard {% component %} tag
This commit is contained in:
parent
82f586c0d1
commit
bd5e169ac1
@ -1,6 +1,6 @@
|
||||
* **Build 91** (2014-05-24)
|
||||
* **Build 92** (2014-05-24)
|
||||
- Components can now be dragged from the side navigation directly on to the page.
|
||||
- Asset maker functions (addJs, addCss, addRss) now use an optional build code, either *core* or a plugin code. This is converted to a version number to ensure updates are not affected by cached assets.
|
||||
- Asset maker methods (addJs, addCss, addRss) now use an optional build code, either *core* or a plugin code. This is converted to a version number to ensure updates are not affected by cached assets.
|
||||
|
||||
* **Build 90** (2014-05-23)
|
||||
- Class `CmsPropertyHelper` has been deprecated, will be removed year > 2014.
|
||||
|
@ -464,9 +464,24 @@
|
||||
* Listen for the click event on the components' remove link
|
||||
*/
|
||||
$(document).on('click', '#cms-master-tabs > div.tab-content > .tab-pane.active .control-componentlist a.remove', function(e) {
|
||||
var pane = $(this).closest('.tab-pane')
|
||||
$(this).trigger('change')
|
||||
$(this).closest('div.layout-cell').remove()
|
||||
var pane = $(this).closest('.tab-pane'),
|
||||
component = $(this).closest('div.layout-cell')
|
||||
|
||||
/*
|
||||
* Remove any {% component %} tags in the editor for this component
|
||||
*/
|
||||
var editor = $('[data-control=codeeditor]', pane)
|
||||
if (editor.length) {
|
||||
var alias = $('input[name="component_aliases[]"]', component).val(),
|
||||
codeEditor = editor.codeEditor('getEditorObject')
|
||||
|
||||
codeEditor.replace('', {
|
||||
needle: "{% component '" + alias + "' %}"
|
||||
})
|
||||
}
|
||||
|
||||
component.remove()
|
||||
$(window).trigger('oc.updateUi')
|
||||
|
||||
updateComponentListClass(pane)
|
||||
|
Loading…
x
Reference in New Issue
Block a user