fnp
/
fnpeditor.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
metaWidget for nodePane module
[fnpeditor.git]
/
modules
/
documentCanvas
/
canvas.js
diff --git
a/modules/documentCanvas/canvas.js
b/modules/documentCanvas/canvas.js
index
9c926e9
..
a1f516d
100644
(file)
--- a/
modules/documentCanvas/canvas.js
+++ b/
modules/documentCanvas/canvas.js
@@
-201,23
+201,36
@@
Canvas.prototype.listCreate = function(options) {
Canvas.prototype.listRemove = function(options) {
var pointerElement = $(this.content.find('#' + options.pointer.getId()));
Canvas.prototype.listRemove = function(options) {
var pointerElement = $(this.content.find('#' + options.pointer.getId()));
- var listElement = options.pointer.
getClass() === 'list-items'
? pointerElement :
+ var listElement = options.pointer.
isOfClass('list-items')
? pointerElement :
pointerElement.parents('[wlxml-class|="list-items"][wlxml-tag]');
pointerElement.parents('[wlxml-class|="list-items"][wlxml-tag]');
- var nested = false;
+ var nested = false,
+ nestedLists;
if(listElement.length > 1) {
listElement = $(listElement[0]);
nested = true;
}
if(nested) {
if(listElement.length > 1) {
listElement = $(listElement[0]);
nested = true;
}
if(nested) {
+ // We are only moving one level up
listElement.unwrap();
} else {
listElement.unwrap();
} else {
+ // We are removing the whole list
+ nestedLists = listElement.find('[wlxml-class=item] > [wlxml-class|=list-items]');
+ nestedLists.unwrap();
listElement.find('[wlxml-class=item]').each(function() {
$(this).removeAttr('wlxml-class');
});
}
listElement.find('[wlxml-class=item]').each(function() {
$(this).removeAttr('wlxml-class');
});
}
+
listElement.children().unwrap();
listElement.children().unwrap();
+
+ var c = this;
+ if(nestedLists) {
+ nestedLists.each(function() {
+ c.listRemove({pointer: canvasNode.create($(this))});
+ });
+ }
};
Canvas.prototype.getPrecedingNode = function(options) {
};
Canvas.prototype.getPrecedingNode = function(options) {