editor: ui for createing enumerated lists
authorAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Tue, 1 Apr 2014 20:23:39 +0000 (22:23 +0200)
committerAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Tue, 1 Apr 2014 20:23:39 +0000 (22:23 +0200)
src/editor/modules/documentCanvas/canvas/wlxmlManagers.js
src/editor/modules/documentCanvas/commands.js
src/editor/modules/documentCanvas/nodes.less
src/editor/modules/documentToolbar/template.html

index 9f7ecfa..6b8b5ff 100644 (file)
@@ -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'});
index a165132..8a26ecc 100644 (file)
@@ -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});
index 78792cc..9ce08d1 100644 (file)
     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;
+        }
     }
 }
 
 
     counter-reset: myitem;
 
-    > [wlxml-class="item"] {
+    > * > [wlxml-class="item"] {
         counter-increment: myitem;
         margin-left: 10px;
         padding-left: 5px;
index b57193a..2e14a89 100644 (file)
@@ -6,7 +6,8 @@
 
     <div class="rng-module-documentToolbar-toolbarGroup">
         <button data-name="new-node" data-meta="header/" data-btn-type="cmd" class="btn btn-mini">nagłówek</button>
-        <button data-name="list" data-btn-type="cmd" data-meta="bullets" class="btn btn-mini">lista</button>
+        <button data-name="list" data-btn-type="cmd" data-meta="bullets" class="btn btn-mini">lista pkt</button>
+        <button data-name="list" data-btn-type="cmd" data-meta="num" class="btn btn-mini">lista num</button>
     </div>
 
     <div class="rng-module-documentToolbar-toolbarGroup">