[PE mobile] Added table reordering.

This commit is contained in:
Julia Radzhabova 2017-01-11 12:22:47 +03:00
parent 7e897bc188
commit 174d5fd5eb
4 changed files with 102 additions and 2 deletions

View file

@ -153,6 +153,8 @@ define([
paletteFillColor && paletteFillColor.on('select', _.bind(me.onFillColor, me));
paletteBorderColor && paletteBorderColor.on('select', _.bind(me.onBorderColor, me));
$('.table-reorder a').single('click', _.bind(me.onReorder, me));
me.initSettings(pageId);
},
@ -456,6 +458,21 @@ define([
$('#edit-table-bordersize .item-after').text(borderSizeTransform.sizeByIndex($target.val()) + ' ' + _metricText);
},
onReorder: function (e) {
var $target = $(e.currentTarget),
type = $target.data('type');
if ('all-up' == type) {
this.api.shapes_bringToFront();
} else if ('all-down' == type) {
this.api.shapes_bringToBack();
} else if ('move-up' == type) {
this.api.shapes_bringForward();
} else if ('move-down' == type) {
this.api.shapes_bringBackward();
}
},
// API handlers
onApiFocusObject: function (objects) {

View file

@ -45,6 +45,15 @@
</div>
</a>
</li>
<li>
<a id="table-reorder" class="item-link">
<div class="item-content">
<div class="item-inner">
<div class="item-title"><%= scope.textReorder %></div>
</div>
</div>
</a>
</li>
</ul>
</div>
<div class="content-block-title"><%= scope.textCellMargins %></div>
@ -293,3 +302,62 @@
</div>
</div>
</div>
<!-- Reorder view -->
<div id="edit-table-reorder">
<div class="navbar">
<div class="navbar-inner">
<div class="left sliding"><a href="#" class="back link"><i class="icon icon-back"></i><% if (!android) { %><span><%= scope.textBack %></span><% } %></a></div>
<div class="center sliding"><%= scope.textReorder %></div>
<div class="right"><% if (phone) { %><a href="#" class="link icon-only close-picker"><i class="icon icon-expand-down"></i></a><% } %></div>
</div>
</div>
<div class="page table-reorder">
<div class="page-content">
<div class="list-block">
<ul>
<li>
<a data-type="all-up" class="item-link no-indicator">
<div class="item-content">
<div class="item-media"><i class="icon icon-move-foreground"></i></div>
<div class="item-inner">
<div class="item-title"><%= scope.textToForeground %></div>
</div>
</div>
</a>
</li>
<li>
<a data-type="all-down" class="item-link no-indicator">
<div class="item-content">
<div class="item-media"><i class="icon icon-move-background"></i></div>
<div class="item-inner">
<div class="item-title"><%= scope.textToBackground %></div>
</div>
</div>
</a>
</li>
<li>
<a data-type="move-up" class="item-link no-indicator">
<div class="item-content">
<div class="item-media"><i class="icon icon-move-forward"></i></div>
<div class="item-inner">
<div class="item-title"><%= scope.textForward %></div>
</div>
</div>
</a>
</li>
<li>
<a data-type="move-down" class="item-link no-indicator">
<div data-type="move-down" class="item-content">
<div class="item-media"><i class="icon icon-move-backward"></i></div>
<div class="item-inner">
<div class="item-title"><%= scope.textBackward %></div>
</div>
</div>
</a>
</li>
</ul>
</div>
</div>
</div>
</div>

View file

@ -73,6 +73,7 @@ define([
$('#edit-table-style-options').single('click', _.bind(me.showTableStyleOptions, me));
$('#edit-table-bordercolor').single('click', _.bind(me.showBorderColor, me));
$('.edit-table-style .categories a').single('click', _.bind(me.showStyleCategory, me));
$('#table-reorder').single('click', _.bind(me.showReorder, me));
me.initControls();
me.renderStyles();
@ -206,6 +207,10 @@ define([
this.showPage('#edit-table-style-options-view');
},
showReorder: function () {
this.showPage('#edit-table-reorder');
},
textRemoveTable: 'Remove Table',
textTableOptions: 'Table Options',
textStyle: 'Style',
@ -222,7 +227,12 @@ define([
textBandedRow: 'Banded Row',
textFirstColumn: 'First Column',
textLastColumn: 'Last Column',
textBandedColumn: 'Banded Column'
textBandedColumn: 'Banded Column',
textReorder: 'Reorder',
textToForeground: 'Bring to Foreground',
textToBackground: 'Send to Background',
textForward: 'Move Forward',
textBackward: 'Move Backward'
}
})(), PE.Views.EditTable || {}))
});

View file

@ -363,6 +363,11 @@
"PE.Views.EditTable.textFirstColumn": "First Column",
"PE.Views.EditTable.textLastColumn": "Last Column",
"PE.Views.EditTable.textBandedColumn": "Banded Column",
"PE.Views.EditTable.textReorder": "Reorder",
"PE.Views.EditTable.textToForeground": "Bring to Foreground",
"PE.Views.EditTable.textToBackground": "Send to Background",
"PE.Views.EditTable.textForward": "Move Forward",
"PE.Views.EditTable.textBackward": "Move Backward",
"PE.Controllers.EditText.textFonts": "Fonts",
"PE.Controllers.EditText.textAuto": "Auto",