From: Aleksander Łukasz Date: Tue, 1 Apr 2014 20:23:39 +0000 (+0200) Subject: editor: ui for createing enumerated lists X-Git-Url: https://git.mdrn.pl/fnpeditor.git/commitdiff_plain/e0b4f012ea85b4b1bc58f2b8531cef068bf572df editor: ui for createing enumerated lists --- diff --git a/src/editor/modules/documentCanvas/canvas/wlxmlManagers.js b/src/editor/modules/documentCanvas/canvas/wlxmlManagers.js index 9f7ecfa..6b8b5ff 100644 --- a/src/editor/modules/documentCanvas/canvas/wlxmlManagers.js +++ b/src/editor/modules/documentCanvas/canvas/wlxmlManagers.js @@ -135,7 +135,6 @@ var ListItemManager = function(wlxmlElement) { $.extend(ListItemManager.prototype, { setup: function() { this.el.clearWidgets(); - this.el.documentElement._container().css({display: 'list-item'}); }, toggleBullet: function(toggle) { this.el.documentElement._container().css({display : toggle ? 'list-item' : 'block'}); diff --git a/src/editor/modules/documentCanvas/commands.js b/src/editor/modules/documentCanvas/commands.js index a165132..8a26ecc 100644 --- a/src/editor/modules/documentCanvas/commands.js +++ b/src/editor/modules/documentCanvas/commands.js @@ -95,7 +95,7 @@ commands.register('list', function(canvas, params) { doc = node1.document; doc.transaction(function() { - doc.createList({node1: node1, node2: node2}); + doc.createList({node1: node1, node2: node2, klass: params.meta === 'num' ? 'list.enum' : 'list'}); }, { success: function() { canvas.setCurrentElement(selectionFocus.element, {caretTo: selectionFocus.offset}); diff --git a/src/editor/modules/documentCanvas/nodes.less b/src/editor/modules/documentCanvas/nodes.less index 78792cc..9ce08d1 100644 --- a/src/editor/modules/documentCanvas/nodes.less +++ b/src/editor/modules/documentCanvas/nodes.less @@ -77,12 +77,18 @@ display:none; } -[wlxml-class|="list"] { +[wlxml-class="list"] { - [wlxml-class|="item"] { - display: list-item; + + > * > [wlxml-class="item"] { margin-left: 10px; padding-left: 5px; + + &:before { + content: '\2022'; + margin-right:10px; + padding-right:10px; + } } } @@ -97,7 +103,7 @@ counter-reset: myitem; - > [wlxml-class="item"] { + > * > [wlxml-class="item"] { counter-increment: myitem; margin-left: 10px; padding-left: 5px; diff --git a/src/editor/modules/documentToolbar/template.html b/src/editor/modules/documentToolbar/template.html index b57193a..2e14a89 100644 --- a/src/editor/modules/documentToolbar/template.html +++ b/src/editor/modules/documentToolbar/template.html @@ -6,7 +6,8 @@
- + +