From af9ccdd1815aea5d1489b9729287bea85519b74f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Aleksander=20=C5=81ukasz?= Date: Thu, 3 Apr 2014 11:34:02 +0200 Subject: [PATCH] editor: removing unused code --- .../documentCanvas/canvas/documentElement.js | 19 ------------------- src/editor/modules/documentCanvas/commands.js | 12 +++--------- 2 files changed, 3 insertions(+), 28 deletions(-) diff --git a/src/editor/modules/documentCanvas/canvas/documentElement.js b/src/editor/modules/documentCanvas/canvas/documentElement.js index f4505b0..5a40f30 100644 --- a/src/editor/modules/documentCanvas/canvas/documentElement.js +++ b/src/editor/modules/documentCanvas/canvas/documentElement.js @@ -57,9 +57,6 @@ $.extend(DocumentElement.prototype, { getVerticallyFirstTextElement: function() { var toret; this.children().some(function(child) { - if(!child.isVisible()) { - return false; // continue - } if(child instanceof DocumentTextElement) { toret = child; return true; // break @@ -87,16 +84,6 @@ $.extend(DocumentElement.prototype, { return this.canvas.getDocumentElement(utils.nearestInDocumentOrder(selector, direction, this.dom()[0])); }, - isVisible: function() { - return this instanceof DocumentTextElement || this.getWlxmlTag() !== 'metadata'; - }, - - isInsideList: function() { - return this.parents().some(function(parent) { - return parent.is('list'); - }); - }, - exec: function(method) { if(this.manager && this.manager[method]) { return this.manager[method].apply(this.manager, Array.prototype.slice.call(arguments, 1)); @@ -226,12 +213,6 @@ $.extend(DocumentNodeElement.prototype, { this.manager = wlxmlManagers.getFor(this); this.manager.setup(); }, - is: function(what) { - if(what === 'list' && _.contains(['list.items', 'list.items.enum'], this.getWlxmlClass())) { - return true; - } - return false; - }, toggleLabel: function(toggle) { var displayCss = toggle ? 'inline-block' : 'none'; var label = this.dom().children('.canvas-widgets').find('.canvas-widget-label'); diff --git a/src/editor/modules/documentCanvas/commands.js b/src/editor/modules/documentCanvas/commands.js index 076478b..1fd2f21 100644 --- a/src/editor/modules/documentCanvas/commands.js +++ b/src/editor/modules/documentCanvas/commands.js @@ -82,15 +82,9 @@ commands.register('list', function(canvas, params) { selectionStart = cursor.getSelectionStart(), selectionEnd = cursor.getSelectionEnd(), parent1 = selectionStart.element.parent() || undefined, - parent2 = selectionEnd.element.parent() || undefined; - - var selectionFocus = cursor.getSelectionFocus(); - - if(selectionStart.element.isInsideList() || selectionEnd.element.isInsideList()) { - return; - } - - var node1 = parent1.wlxmlNode, + parent2 = selectionEnd.element.parent() || undefined, + selectionFocus = cursor.getSelectionFocus(), + node1 = parent1.wlxmlNode, node2 = parent2.wlxmlNode, doc = node1.document; -- 2.20.1