Commit ef65270e authored by Alexander Yuzhin's avatar Alexander Yuzhin

[DE mobile] Fix bug 33945

parent 0e769a52
...@@ -92,11 +92,11 @@ define([ ...@@ -92,11 +92,11 @@ define([
me.api.asc_GetDefaultTableStyles(); me.api.asc_GetDefaultTableStyles();
} }
$('#add-table li').single('click', _.buffered(this.onStyleClick, 300, this)); $('#add-table li').single('click', _.buffered(this.onStyleClick, 100, this));
}, },
onViewRender: function () { onViewRender: function () {
$('#add-table li').single('click', _.buffered(this.onStyleClick, 300, this)); $('#add-table li').single('click', _.buffered(this.onStyleClick, 100, this));
}, },
onStyleClick: function (e) { onStyleClick: function (e) {
...@@ -104,64 +104,66 @@ define([ ...@@ -104,64 +104,66 @@ define([
$target = $(e.currentTarget), $target = $(e.currentTarget),
type = $target.data('type'); type = $target.data('type');
if ($('.modal.modal-in').length > 0) {
return
}
DE.getController('AddContainer').hideModal(); DE.getController('AddContainer').hideModal();
_.delay(function () { if ($target) {
if ($target) { var picker;
var picker; var modal = uiApp.modal({
var modal = uiApp.modal({ title: me.textTableSize,
title: me.textTableSize, text: '',
text: '', afterText:
afterText: '<div class="content-block">' +
'<div class="content-block">' + '<div class="row">' +
'<div class="row">' + '<div class="col-50">' + me.textColumns + '</div>' +
'<div class="col-50">' + me.textColumns + '</div>' + '<div class="col-50">' + me.textRows + '</div>' +
'<div class="col-50">' + me.textRows + '</div>' + '</div>' +
'</div>' + '<div id="picker-table-size"></div>' +
'<div id="picker-table-size"></div>' + '</div>',
'</div>', buttons: [
buttons: [ {
{ text: me.textCancel
text: me.textCancel },
}, {
{ text: 'OK',
text: 'OK', bold: true,
bold: true, onClick: function () {
onClick: function () { var size = picker.value;
var size = picker.value;
if (me.api) {
if (me.api) { me.api.put_Table(parseInt(size[0]), parseInt(size[1]));
me.api.put_Table(parseInt(size[0]), parseInt(size[1]));
var properties = new Asc.CTableProp();
var properties = new Asc.CTableProp(); properties.put_TableStyle(type);
properties.put_TableStyle(type);
me.api.tblApply(properties);
me.api.tblApply(properties);
}
} }
} }
] }
}); ]
});
picker = uiApp.picker({ picker = uiApp.picker({
container: '#picker-table-size', container: '#picker-table-size',
toolbar: false, toolbar: false,
rotateEffect: true, rotateEffect: true,
value: [3, 3], value: [3, 3],
cols: [{ cols: [{
textAlign: 'left', textAlign: 'left',
values: [1,2,3,4,5,6,7,8,9,10] values: [1,2,3,4,5,6,7,8,9,10]
}, { }, {
values: [1,2,3,4,5,6,7,8,9,10] values: [1,2,3,4,5,6,7,8,9,10]
}] }]
}); });
// Vertical align // Vertical align
$$(modal).css({ $$(modal).css({
marginTop: - Math.round($$(modal).outerHeight() / 2) + 'px' marginTop: - Math.round($$(modal).outerHeight() / 2) + 'px'
}); });
} }
}, 300);
}, },
// Public // Public
......
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