simpler rmClone
This commit is contained in:
parent
da583628e2
commit
610ee5df38
@ -919,10 +919,12 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
Post.prototype.rmClone = function(index) {
|
Post.prototype.rmClone = function(index) {
|
||||||
var i, _i, _ref;
|
var clone, _i, _len, _ref;
|
||||||
this.clones.splice(index, 1);
|
this.clones.splice(index, 1);
|
||||||
for (i = _i = index, _ref = this.clones.length; index <= _ref ? _i < _ref : _i > _ref; i = index <= _ref ? ++_i : --_i) {
|
_ref = this.clones.slice(index);
|
||||||
this.clones[i].nodes.root.setAttribute('data-clone', i);
|
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
||||||
|
clone = _ref[_i];
|
||||||
|
clone.nodes.root.setAttribute('data-clone', index++);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -718,8 +718,8 @@ class Post
|
|||||||
new Clone @, context
|
new Clone @, context
|
||||||
rmClone: (index) ->
|
rmClone: (index) ->
|
||||||
@clones.splice index, 1
|
@clones.splice index, 1
|
||||||
for i in [index...@clones.length]
|
for clone in @clones[index..]
|
||||||
@clones[i].nodes.root.setAttribute 'data-clone', i
|
clone.nodes.root.setAttribute 'data-clone', index++
|
||||||
return
|
return
|
||||||
|
|
||||||
class Clone extends Post
|
class Clone extends Post
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user