Commit bf10598c authored by Maxim Kadushkin's avatar Maxim Kadushkin

[SSE mobile] separate 'add hyperlink' option

parent 64c1b76f
...@@ -131,8 +131,9 @@ define([ ...@@ -131,8 +131,9 @@ define([
break; break;
case 'addlink': case 'addlink':
me.view.hideMenu(); me.view.hideMenu();
SSE.getController('AddContainer').showModal(); SSE.getController('AddContainer').showModal({
SSE.getController('AddOther').getView('AddOther').showInsertLink(); panel: 'hyperlink'
});
break; break;
case 'openlink': case 'openlink':
var linkinfo = info.asc_getHyperlink(); var linkinfo = info.asc_getHyperlink();
......
...@@ -104,7 +104,7 @@ define([ ...@@ -104,7 +104,7 @@ define([
} }
options = opts; options = opts;
parentButton = !opts ? '#toolbar-add' : opts.button; parentButton = !opts || !opts.button ? '#toolbar-add' : opts.button;
me._showByStack(Common.SharedSettings.get('phone')); me._showByStack(Common.SharedSettings.get('phone'));
this.api.asc_closeCellEditor(); this.api.asc_closeCellEditor();
...@@ -151,6 +151,15 @@ define([ ...@@ -151,6 +151,15 @@ define([
layout: SSE.getController('AddOther').getView('AddOther').rootLayout() layout: SSE.getController('AddOther').getView('AddOther').rootLayout()
}); });
if ( options && options.panel == 'hyperlink' ) {
var view = SSE.getController('AddLink').getView();
addViews.push({
caption: view.getTitle(),
id: 'add-link',
layout: view.rootLayout()
});
}
return addViews; return addViews;
}, },
...@@ -174,11 +183,15 @@ define([ ...@@ -174,11 +183,15 @@ define([
); );
if (layoutAdds.length < 2) { if (layoutAdds.length == 1) {
$layoutNavbar $layoutNavbar
.find('.center') .find('.center')
.removeClass('categories') .removeClass('categories')
.html(layoutAdds[0].caption); .html(layoutAdds[0].caption);
$layoutPages = $('<div class="pages">' +
layoutAdds[0].layout +
'</div>');
} else { } else {
if (isAndroid) { if (isAndroid) {
$layoutNavbar $layoutNavbar
...@@ -208,36 +221,34 @@ define([ ...@@ -208,36 +221,34 @@ define([
); );
}); });
} }
}
// Content // Content
var $layoutPages = $( var _arrangePages = _.template(
'<div class="pages">' + '<% _.each(pages, function(view, index) { %>' +
'<div class="page" data-page="index">' + '<div id="<%= view.id %>" class="tab view<% if (index < 1) print(" active"); %>">' +
'<div class="page-content">' + '<div class="pages">' +
'<div class="tabs-animated-wrap">' + '<div class="page no-navbar">' +
'<div class="tabs"></div>' + '<div class="page-content">' +
'</div>' + '<%= view.layout %>' +
'</div>' + '</div>' +
'</div>' +
'</div>'
);
_.each(layoutAdds, function (addView, index) {
$layoutPages.find('.tabs').append(
'<div id="' + addView.id + '" class="tab view ' + (index < 1 ? 'active' : '') + '">' +
'<div class="pages">' +
'<div class="page no-navbar">' +
'<div class="page-content">' +
addView.layout +
'</div>' + '</div>' +
'</div>' + '</div>' +
'</div>' + '</div>' +
'</div>' '<% }); %>');
);
}); var $layoutPages = $('<div class="pages">' +
'<div class="page" data-page="index">' +
'<div class="page-content">' +
'<div class="tabs-animated-wrap">' +
'<div class="tabs">' +
_arrangePages({pages: layoutAdds}) +
'</div>' +
'</div>' +
'</div>' +
'</div>' +
'</div>');
}
if (isPhone) { if (isPhone) {
me.picker = $$(uiApp.popup( me.picker = $$(uiApp.popup(
...@@ -288,7 +299,7 @@ define([ ...@@ -288,7 +299,7 @@ define([
domCache: true domCache: true
}); });
Common.NotificationCenter.trigger('addcontainer:show'); Common.NotificationCenter.trigger('addcontainer:show', options);
}, },
textChart: 'Chart', textChart: 'Chart',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment