clone: avoid cloning the to-be-purged previous instance of the clone when recreating
This commit is contained in:
parent
7209a64d89
commit
af6d9712e9
1 changed files with 4 additions and 3 deletions
|
|
@ -47,8 +47,9 @@ module.exports = class Clone extends _widgets_base {
|
|||
|
||||
$('body').on(`widget-created.${this.hash}`, (e)=>{
|
||||
var {id, hash} = e
|
||||
if ((id == this.getProp('widgetId') && this.cloneHash.indexOf(hash) == -1) ||
|
||||
(widgetManager.widgets[this.originalHash] && widgetManager.widgets[this.originalHash].hashes && widgetManager.widgets[this.originalHash].hashes.indexOf(hash) != -1)
|
||||
if ((id == this.getProp('widgetId') && this.cloneHash.indexOf(hash) == -1)
|
||||
// ||
|
||||
// (widgetManager.widgets[this.originalHash] && widgetManager.widgets[this.originalHash].hashes && widgetManager.widgets[this.originalHash].hashes.indexOf(hash) != -1)
|
||||
) {
|
||||
this.createClone()
|
||||
}
|
||||
|
|
@ -72,7 +73,7 @@ module.exports = class Clone extends _widgets_base {
|
|||
|
||||
if (widgets.length) {
|
||||
|
||||
for (var i in widgets) {
|
||||
for (var i = widgets.length - 1; i>=0; i--) {
|
||||
|
||||
if (this.cloneHash.indexOf(widgets[i].hash) == -1) {
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue