[Mobile] Go to editing mode from toolbar

This commit is contained in:
Julia Radzhabova 2018-04-18 14:47:48 +03:00
parent 8cb2861691
commit 291128cad7
6 changed files with 33 additions and 3 deletions

View file

@ -34,6 +34,9 @@
<a href="#" id="toolbar-add" class="link icon-only" style="display: none;"> <a href="#" id="toolbar-add" class="link icon-only" style="display: none;">
<i class="icon icon-plus"></i> <i class="icon icon-plus"></i>
</a> </a>
<a href="#" id="toolbar-edit-document" class="link icon-only" style="display: none;">
<i class="icon icon-edit"></i>
</a>
<% if (!phone) { %> <% if (!phone) { %>
<a href="#" id="toolbar-search" class="link icon-only"> <a href="#" id="toolbar-search" class="link icon-only">
<i class="icon icon-search"></i> <i class="icon icon-search"></i>

View file

@ -62,7 +62,8 @@ define([
"click #toolbar-search" : "searchToggle", "click #toolbar-search" : "searchToggle",
"click #toolbar-edit" : "showEdition", "click #toolbar-edit" : "showEdition",
"click #toolbar-add" : "showInserts", "click #toolbar-add" : "showInserts",
"click #toolbar-settings" : "showSettings" "click #toolbar-settings" : "showSettings",
"click #toolbar-edit-document": "editDocument"
}, },
// Set innerHTML and get the references to the DOM elements // Set innerHTML and get the references to the DOM elements
@ -100,6 +101,8 @@ define([
setMode: function (mode) { setMode: function (mode) {
if (mode.isEdit) { if (mode.isEdit) {
$('#toolbar-edit, #toolbar-add, #toolbar-undo, #toolbar-redo').show(); $('#toolbar-edit, #toolbar-add, #toolbar-undo, #toolbar-redo').show();
} else if (mode.canEdit && mode.canRequestEditRights){
$('#toolbar-edit-document').show();
} }
}, },
@ -147,6 +150,10 @@ define([
DE.getController('Settings').showModal(); DE.getController('Settings').showModal();
}, },
editDocument: function () {
Common.Gateway.requestEditRights();
},
textBack: 'Back' textBack: 'Back'
} }
})(), DE.Views.Toolbar || {})) })(), DE.Views.Toolbar || {}))

View file

@ -37,6 +37,9 @@
<a href="#" id="toolbar-add" class="link icon-only" style="display: none;"> <a href="#" id="toolbar-add" class="link icon-only" style="display: none;">
<i class="icon icon-plus"></i> <i class="icon icon-plus"></i>
</a> </a>
<a href="#" id="toolbar-edit-document" class="link icon-only" style="display: none;">
<i class="icon icon-edit"></i>
</a>
<% if (!phone) { %> <% if (!phone) { %>
<a href="#" id="toolbar-search" class="link icon-only"> <a href="#" id="toolbar-search" class="link icon-only">
<i class="icon icon-search"></i> <i class="icon icon-search"></i>

View file

@ -63,7 +63,8 @@ define([
"click #toolbar-edit" : "showEdition", "click #toolbar-edit" : "showEdition",
"click #toolbar-add" : "showInserts", "click #toolbar-add" : "showInserts",
"click #toolbar-settings" : "showSettings", "click #toolbar-settings" : "showSettings",
"click #toolbar-preview" : "showPreview" "click #toolbar-preview" : "showPreview",
"click #toolbar-edit-document": "editDocument"
}, },
// Set innerHTML and get the references to the DOM elements // Set innerHTML and get the references to the DOM elements
@ -101,6 +102,8 @@ define([
setMode: function (mode) { setMode: function (mode) {
if (mode.isEdit) { if (mode.isEdit) {
$('#toolbar-edit, #toolbar-add, #toolbar-undo, #toolbar-redo').show(); $('#toolbar-edit, #toolbar-add, #toolbar-undo, #toolbar-redo').show();
} else if (mode.canEdit && mode.canRequestEditRights){
$('#toolbar-edit-document').show();
} }
}, },
@ -152,6 +155,10 @@ define([
PE.getController('DocumentPreview').show(); PE.getController('DocumentPreview').show();
}, },
editDocument: function () {
Common.Gateway.requestEditRights();
},
textBack: 'Back' textBack: 'Back'
} }
})(), PE.Views.Toolbar || {})) })(), PE.Views.Toolbar || {}))

View file

@ -34,6 +34,9 @@
<a href="#" id="toolbar-add" class="link icon-only" style="display: none;"> <a href="#" id="toolbar-add" class="link icon-only" style="display: none;">
<i class="icon icon-plus"></i> <i class="icon icon-plus"></i>
</a> </a>
<a href="#" id="toolbar-edit-document" class="link icon-only" style="display: none;">
<i class="icon icon-edit"></i>
</a>
<% if (!phone) { %> <% if (!phone) { %>
<a href="#" id="toolbar-search" class="link icon-only"> <a href="#" id="toolbar-search" class="link icon-only">
<i class="icon icon-search"></i> <i class="icon icon-search"></i>

View file

@ -62,7 +62,8 @@ define([
"click #toolbar-search" : "searchToggle", "click #toolbar-search" : "searchToggle",
"click #toolbar-edit" : "showEdition", "click #toolbar-edit" : "showEdition",
"click #toolbar-add" : "showInserts", "click #toolbar-add" : "showInserts",
"click #toolbar-settings" : "showSettings" "click #toolbar-settings" : "showSettings",
"click #toolbar-edit-document": "editDocument"
}, },
// Set innerHTML and get the references to the DOM elements // Set innerHTML and get the references to the DOM elements
@ -93,6 +94,8 @@ define([
setMode: function (mode) { setMode: function (mode) {
if (mode.isEdit) { if (mode.isEdit) {
$('#toolbar-edit, #toolbar-add, #toolbar-undo, #toolbar-redo').show(); $('#toolbar-edit, #toolbar-add, #toolbar-undo, #toolbar-redo').show();
} else if (mode.canEdit && mode.canRequestEditRights){
$('#toolbar-edit-document').show();
} }
}, },
@ -148,6 +151,10 @@ define([
this.$btnEdit.toggleClass('disabled', val); this.$btnEdit.toggleClass('disabled', val);
}, },
editDocument: function () {
Common.Gateway.requestEditRights();
},
textBack: 'Back' textBack: 'Back'
} }
})(), SSE.Views.Toolbar || {})) })(), SSE.Views.Toolbar || {}))