[de] Sailfish scroll support
This commit is contained in:
parent
fbf6908041
commit
fa94ae05f0
|
@ -111,4 +111,18 @@ define([
|
|||
// Apply Styles
|
||||
$popover.css({top: modalTop + 'px', left: modalLeft + 'px'});
|
||||
};
|
||||
|
||||
Common.Utils.addScrollIfNeed = function (targetSelector, containerSelector) {
|
||||
if (Common.SharedSettings.get('sailfish')) {
|
||||
var $targetEl = $(targetSelector);
|
||||
var $containerEl = $(containerSelector);
|
||||
|
||||
if ($targetEl.length == 0 || $containerEl == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
$containerEl.css('height', 'auto');
|
||||
new IScroll(targetSelector);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
@ -206,16 +206,21 @@ define([
|
|||
|
||||
if ('#settings-document-view' == pageId) {
|
||||
me.initPageDocumentSettings();
|
||||
Common.Utils.addScrollIfNeed('.page[data-page=settings-document-view]', '.page[data-page=settings-document-view] .page-content');
|
||||
} else if ('#settings-document-formats-view' == pageId) {
|
||||
me.getView('Settings').renderPageSizes(_pageSizes, _pageSizesIndex);
|
||||
$('.page[data-page=settings-document-formats-view] input:radio[name=document-format]').single('change', _.bind(me.onFormatChange, me));
|
||||
Common.Utils.addScrollIfNeed('.page[data-page=settings-document-formats-view]', '.page[data-page=settings-document-formats-view] .page-content');
|
||||
} else if ('#settings-download-view' == pageId) {
|
||||
$(modalView).find('.formats a').single('click', _.bind(me.onSaveFormat, me));
|
||||
Common.Utils.addScrollIfNeed('.page[data-page=settings-download-view]', '.page[data-page=settings-download-view] .page-content');
|
||||
} else if ('#settings-info-view' == pageId) {
|
||||
me.initPageInfo();
|
||||
Common.Utils.addScrollIfNeed('.page[data-page=settings-info-view]', '.page[data-page=settings-info-view] .page-content');
|
||||
} else if ('#settings-about-view' == pageId) {
|
||||
// About
|
||||
me.setLicInfo(_licInfo);
|
||||
Common.Utils.addScrollIfNeed('.page[data-page=settings-about-view]', '.page[data-page=settings-about-view] .page-content');
|
||||
} else {
|
||||
$('#settings-readermode input:checkbox').attr('checked', Common.SharedSettings.get('readerMode'));
|
||||
$('#settings-spellcheck input:checkbox').attr('checked', Common.localStorage.getBool("de-mobile-spellcheck", false));
|
||||
|
|
|
@ -189,11 +189,24 @@ define([
|
|||
if (_tableObject) {
|
||||
if (pageId == '#edit-table-wrap') {
|
||||
me._initWrappView();
|
||||
Common.Utils.addScrollIfNeed('.page[data-page=edit-table-wrap]', '.page[data-page=edit-table-wrap] .page-content');
|
||||
} else if (pageId == "#edit-table-style" || pageId == '#edit-table-border-color-view') {
|
||||
me._initStyleView();
|
||||
|
||||
if (pageId == '#edit-table-border-color-view') {
|
||||
Common.Utils.addScrollIfNeed('.page[data-page=edit-table-border-color]', '.page[data-page=edit-table-border-color] .page-content');
|
||||
} else {
|
||||
Common.Utils.addScrollIfNeed('.page[data-page=edit-table-style]', '.page[data-page=edit-table-style] .page-content');
|
||||
}
|
||||
|
||||
Common.Utils.addScrollIfNeed('#tab-table-border .list-block', '#tab-table-border .list-block ul');
|
||||
Common.Utils.addScrollIfNeed('#tab-table-fill .list-block', '#tab-table-fill .list-block ul');
|
||||
Common.Utils.addScrollIfNeed('#tab-table-style .list-block', '#tab-table-style .list-block ul');
|
||||
} else if (pageId == '#edit-table-options') {
|
||||
Common.Utils.addScrollIfNeed('.page[data-page=edit-table-wrap]', '.page[data-page=edit-table-wrap] .page-content');
|
||||
me._initTableOptionsView();
|
||||
} else if (pageId == '#edit-table-style-options-view') {
|
||||
Common.Utils.addScrollIfNeed('.page[data-page=edit-table-style-options]', '.page[data-page=edit-table-style-options] .page-content');
|
||||
me._initStyleOptionsView();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -79,6 +79,7 @@ define([
|
|||
initEvents: function () {
|
||||
var me = this;
|
||||
|
||||
Common.Utils.addScrollIfNeed('.view[data-page=settings-root-view] .pages', '.view[data-page=settings-root-view] .page');
|
||||
me.updateItemHandlers();
|
||||
me.initControls();
|
||||
},
|
||||
|
|
|
@ -105,6 +105,7 @@ define([
|
|||
|
||||
$('.edit-chart-style .categories a').single('click', _.bind(me.showStyleCategory, me));
|
||||
|
||||
Common.Utils.addScrollIfNeed('#edit-chart .pages', '#edit-chart .page');
|
||||
me.initControls();
|
||||
me.renderStyles();
|
||||
},
|
||||
|
@ -220,15 +221,18 @@ define([
|
|||
transparent: true
|
||||
});
|
||||
|
||||
|
||||
this.fireEvent('page:show', [this, selector]);
|
||||
},
|
||||
|
||||
showWrap: function () {
|
||||
this.showPage('#edit-chart-wrap');
|
||||
Common.Utils.addScrollIfNeed('.page.chart-wrap', '.page.chart-wrap .page-content');
|
||||
},
|
||||
|
||||
showReorder: function () {
|
||||
this.showPage('#edit-chart-reorder');
|
||||
Common.Utils.addScrollIfNeed('.page.chart-reorder', '.page.chart-reorder .page-content');
|
||||
},
|
||||
|
||||
showBorderColor: function () {
|
||||
|
|
|
@ -65,6 +65,7 @@ define([
|
|||
var me = this;
|
||||
|
||||
DE.getController('EditHeader').initSettings();
|
||||
Common.Utils.addScrollIfNeed('#edit-header .pages', '#edit-header .page');
|
||||
},
|
||||
|
||||
// Render layout
|
||||
|
|
|
@ -69,6 +69,7 @@ define([
|
|||
$('#edit-link-url input[type=url]').single('input', _.bind(function(e) {
|
||||
$('#edit-link-edit').toggleClass('disabled', _.isEmpty($(e.currentTarget).val()));
|
||||
}, this));
|
||||
Common.Utils.addScrollIfNeed('#edit-link .pages', '#edit-link .page');
|
||||
},
|
||||
|
||||
categoryShow: function(e) {
|
||||
|
|
|
@ -72,6 +72,7 @@ define([
|
|||
$('#image-reorder').single('click', _.bind(me.showReorder, me));
|
||||
$('#edit-image-url').single('click', _.bind(me.showEditUrl, me));
|
||||
|
||||
Common.Utils.addScrollIfNeed('#edit-image .pages', '#edit-image .page');
|
||||
me.initControls();
|
||||
},
|
||||
|
||||
|
@ -130,6 +131,7 @@ define([
|
|||
showWrap: function () {
|
||||
this.showPage('#edit-image-wrap-view');
|
||||
$('.image-wrap .list-block.inputs-list').removeClass('inputs-list');
|
||||
Common.Utils.addScrollIfNeed('.page.image-wrap', '.page.image-wrap .page-content');
|
||||
},
|
||||
|
||||
showReplace: function () {
|
||||
|
@ -138,6 +140,7 @@ define([
|
|||
|
||||
showReorder: function () {
|
||||
this.showPage('#edit-image-reorder-view');
|
||||
Common.Utils.addScrollIfNeed('.page.image-reorder', '.page.image-reorder .page-content');
|
||||
},
|
||||
|
||||
showEditUrl: function () {
|
||||
|
@ -150,6 +153,7 @@ define([
|
|||
_.delay(function () {
|
||||
$('.edit-image-url-link input[type="url"]').focus();
|
||||
}, 1000);
|
||||
Common.Utils.addScrollIfNeed('.page.edit-image-url-link', '.page.edit-image-url-link .page-content');
|
||||
},
|
||||
|
||||
textWrap: 'Wrap',
|
||||
|
|
|
@ -75,6 +75,7 @@ define([
|
|||
me.renderStyles();
|
||||
|
||||
DE.getController('EditParagraph').initSettings();
|
||||
Common.Utils.addScrollIfNeed('#edit-paragraph .pages', '#edit-paragraph .page');
|
||||
},
|
||||
|
||||
// Render layout
|
||||
|
@ -150,11 +151,13 @@ define([
|
|||
transparent: true
|
||||
});
|
||||
|
||||
Common.Utils.addScrollIfNeed('.page[data-page=edit-paragraph-color]', '.page[data-page=edit-paragraph-color] .page-content');
|
||||
this.fireEvent('page:show', [this, '#edit-paragraph-color']);
|
||||
},
|
||||
|
||||
showAdvanced: function () {
|
||||
this.showPage('#edit-paragraph-advanced');
|
||||
Common.Utils.addScrollIfNeed('.page[data-page=edit-paragraph-advanced]', '.page[data-page=edit-paragraph-advanced] .page-content');
|
||||
},
|
||||
|
||||
textBackground: 'Background',
|
||||
|
|
|
@ -76,6 +76,7 @@ define([
|
|||
|
||||
$('.edit-shape-style .categories a').single('click', _.bind(me.showStyleCategory, me));
|
||||
|
||||
Common.Utils.addScrollIfNeed('#edit-shape .pages', '#edit-shape .page');
|
||||
me.initControls();
|
||||
},
|
||||
|
||||
|
@ -154,19 +155,23 @@ define([
|
|||
transparent: true
|
||||
});
|
||||
|
||||
// Common.Utils.addScrollIfNeed('.page[data-page=edit-text-font-color]', '.page[data-page=edit-text-font-color] .page-content');
|
||||
this.fireEvent('page:show', [this, selector]);
|
||||
},
|
||||
|
||||
showWrap: function () {
|
||||
this.showPage('#edit-shape-wrap');
|
||||
Common.Utils.addScrollIfNeed('.page.shape-wrap', '.page.shape-wrap .page-content');
|
||||
},
|
||||
|
||||
showReplace: function () {
|
||||
this.showPage('#edit-shape-replace');
|
||||
Common.Utils.addScrollIfNeed('.page.shape-replace', '.page.shape-replace .page-content');
|
||||
},
|
||||
|
||||
showReorder: function () {
|
||||
this.showPage('#edit-shape-reorder');
|
||||
Common.Utils.addScrollIfNeed('.page.shape-reorder', '.page.shape-reorder .page-content');
|
||||
},
|
||||
|
||||
showBorderColor: function () {
|
||||
|
|
|
@ -76,6 +76,7 @@ define([
|
|||
$('#edit-table-bordercolor').single('click', _.bind(me.showBorderColor, me));
|
||||
$('.edit-table-style .categories a').single('click', _.bind(me.showStyleCategory, me));
|
||||
|
||||
Common.Utils.addScrollIfNeed('#edit-table .pages', '#edit-table .page');
|
||||
me.initControls();
|
||||
me.renderStyles();
|
||||
},
|
||||
|
@ -158,6 +159,7 @@ define([
|
|||
if ($(e.currentTarget).data('type') == 'fill') {
|
||||
this.fireEvent('page:show', [this, '#edit-table-style']);
|
||||
}
|
||||
// this.fireEvent('page:show', [this, '#edit-table-style']);
|
||||
},
|
||||
|
||||
showPage: function (templateId, suspendEvent) {
|
||||
|
|
|
@ -108,6 +108,7 @@ define([
|
|||
$('#font-bullets').single('click', _.bind(me.showBullets, me));
|
||||
$('#font-numbers').single('click', _.bind(me.showNumbers, me));
|
||||
|
||||
Common.Utils.addScrollIfNeed('#edit-text .pages', '#edit-text .page');
|
||||
me.initControls();
|
||||
},
|
||||
|
||||
|
@ -189,6 +190,8 @@ define([
|
|||
}, 100));
|
||||
}
|
||||
});
|
||||
|
||||
Common.Utils.addScrollIfNeed('.page[data-page=edit-text-font-page]', '.page[data-page=edit-text-font-page] .page-content');
|
||||
},
|
||||
|
||||
showFontColor: function () {
|
||||
|
@ -198,6 +201,7 @@ define([
|
|||
el: $('.page[data-page=edit-text-font-color] .page-content')
|
||||
});
|
||||
|
||||
Common.Utils.addScrollIfNeed('.page[data-page=edit-text-font-color]', '.page[data-page=edit-text-font-color] .page-content');
|
||||
this.fireEvent('page:show', [this, '#edit-text-color']);
|
||||
},
|
||||
|
||||
|
@ -209,15 +213,18 @@ define([
|
|||
transparent: true
|
||||
});
|
||||
|
||||
Common.Utils.addScrollIfNeed('.page[data-page=edit-text-font-background]', '.page[data-page=edit-text-font-background] .page-content');
|
||||
this.fireEvent('page:show', [this, '#edit-text-background']);
|
||||
},
|
||||
|
||||
showAdditional: function () {
|
||||
this.showPage('#edit-text-additional');
|
||||
Common.Utils.addScrollIfNeed('.page[data-page=edit-text-additional]', '.page[data-page=edit-text-additional] .page-content');
|
||||
},
|
||||
|
||||
showLineSpacing: function () {
|
||||
this.showPage('#edit-text-linespacing');
|
||||
Common.Utils.addScrollIfNeed('#page-text-linespacing', '#page-text-linespacing .page-content');
|
||||
},
|
||||
|
||||
showBullets: function () {
|
||||
|
|
|
@ -256,6 +256,7 @@
|
|||
Object.defineProperty(navigator, 'userAgent', {
|
||||
get: function () { return ua; }
|
||||
});
|
||||
document.write('<script type="text/javascript" src="../../../vendor/iscroll/iscroll.js"><\/script>');
|
||||
}
|
||||
|
||||
window.sdk_dev_scrpipts.forEach(function(item){
|
||||
|
|
|
@ -192,6 +192,7 @@
|
|||
Object.defineProperty(navigator, 'userAgent', {
|
||||
get: function () { return ua; }
|
||||
});
|
||||
document.write('<script type="text/javascript" src="../../../vendor/iscroll/iscroll.js"><\/script>');
|
||||
}
|
||||
|
||||
function getUrlParams() {
|
||||
|
|
|
@ -874,7 +874,7 @@ p {
|
|||
width: 100%;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
background: #000;
|
||||
background: #efeff4;
|
||||
}
|
||||
.page {
|
||||
box-sizing: border-box;
|
||||
|
|
2091
vendor/iscroll/iscroll.js
vendored
Normal file
2091
vendor/iscroll/iscroll.js
vendored
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue