[se] Sailfish scroll support
This commit is contained in:
parent
c80577e82a
commit
bb3f4bc16a
|
@ -114,15 +114,17 @@ define([
|
||||||
|
|
||||||
Common.Utils.addScrollIfNeed = function (targetSelector, containerSelector) {
|
Common.Utils.addScrollIfNeed = function (targetSelector, containerSelector) {
|
||||||
if (Common.SharedSettings.get('sailfish')) {
|
if (Common.SharedSettings.get('sailfish')) {
|
||||||
var $targetEl = $(targetSelector);
|
_.delay(function(){
|
||||||
var $containerEl = $(containerSelector);
|
var $targetEl = $(targetSelector);
|
||||||
|
var $containerEl = $(containerSelector);
|
||||||
if ($targetEl.length == 0 || $containerEl == 0) {
|
|
||||||
return;
|
if ($targetEl.length == 0 || $containerEl == 0) {
|
||||||
}
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$containerEl.css('height', 'auto');
|
$containerEl.css('height', 'auto');
|
||||||
new IScroll(targetSelector);
|
new IScroll(targetSelector);
|
||||||
|
}, 500);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -147,14 +147,19 @@ define([
|
||||||
me.initStylePage();
|
me.initStylePage();
|
||||||
} else if ('#edit-chart-border-color-view' == pageId) {
|
} else if ('#edit-chart-border-color-view' == pageId) {
|
||||||
me.initBorderColorPage();
|
me.initBorderColorPage();
|
||||||
|
Common.Utils.addScrollIfNeed('.page[data-page=edit-chart-border-color]', '.page[data-page=edit-chart-border-color] .page-content');
|
||||||
} else if ('#edit-chart-layout' == pageId) {
|
} else if ('#edit-chart-layout' == pageId) {
|
||||||
me.initLayoutPage();
|
me.initLayoutPage();
|
||||||
|
Common.Utils.addScrollIfNeed('.page[data-page=edit-chart-layout]', '.page[data-page=edit-chart-layout] .page-content');
|
||||||
} else if ('#edit-chart-vertical-axis' == pageId) {
|
} else if ('#edit-chart-vertical-axis' == pageId) {
|
||||||
me.initVertAxisPage();
|
me.initVertAxisPage();
|
||||||
|
Common.Utils.addScrollIfNeed('.page[data-page=edit-chart-vertical-axis]', '.page[data-page=edit-chart-vertical-axis] .page-content');
|
||||||
} else if ('#edit-chart-horizontal-axis' == pageId) {
|
} else if ('#edit-chart-horizontal-axis' == pageId) {
|
||||||
me.initHorAxisPage();
|
me.initHorAxisPage();
|
||||||
|
Common.Utils.addScrollIfNeed('.page[data-page=edit-chart-horizontal-axis]', '.page[data-page=edit-chart-horizontal-axis] .page-content');
|
||||||
} else if ('#edit-chart-reorder' == pageId) {
|
} else if ('#edit-chart-reorder' == pageId) {
|
||||||
me.initReorderPage();
|
me.initReorderPage();
|
||||||
|
Common.Utils.addScrollIfNeed('.page[data-page=edit-chart-reorder]', '.page[data-page=edit-chart-reorder] .page-content');
|
||||||
} else {
|
} else {
|
||||||
me.initRootPage();
|
me.initRootPage();
|
||||||
}
|
}
|
||||||
|
|
|
@ -80,6 +80,7 @@ define([
|
||||||
$('#settings-help').single('click', _.bind(me.showHelp, me));
|
$('#settings-help').single('click', _.bind(me.showHelp, me));
|
||||||
$('#settings-about').single('click', _.bind(me.showAbout, me));
|
$('#settings-about').single('click', _.bind(me.showAbout, me));
|
||||||
|
|
||||||
|
Common.Utils.addScrollIfNeed('.view[data-page=settings-root-view] .pages', '.view[data-page=settings-root-view] .page');
|
||||||
me.initControls();
|
me.initControls();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -170,10 +171,13 @@ define([
|
||||||
$('#settings-document-title').html(document.title ? document.title : this.unknownText);
|
$('#settings-document-title').html(document.title ? document.title : this.unknownText);
|
||||||
$('#settings-document-autor').html(info.author ? info.author : this.unknownText);
|
$('#settings-document-autor').html(info.author ? info.author : this.unknownText);
|
||||||
$('#settings-document-date').html(info.created ? info.created : this.unknownText);
|
$('#settings-document-date').html(info.created ? info.created : this.unknownText);
|
||||||
|
|
||||||
|
Common.Utils.addScrollIfNeed('.page[data-page=settings-info-view]', '.page[data-page=settings-info-view] .page-content');
|
||||||
},
|
},
|
||||||
|
|
||||||
showDownload: function () {
|
showDownload: function () {
|
||||||
this.showPage('#settings-download-view');
|
this.showPage('#settings-download-view');
|
||||||
|
Common.Utils.addScrollIfNeed('.page[data-page=settings-download-view]', '.page[data-page=settings-download-view] .page-content');
|
||||||
},
|
},
|
||||||
|
|
||||||
showHistory: function () {
|
showHistory: function () {
|
||||||
|
@ -186,6 +190,7 @@ define([
|
||||||
|
|
||||||
showAbout: function () {
|
showAbout: function () {
|
||||||
this.showPage('#settings-about-view');
|
this.showPage('#settings-about-view');
|
||||||
|
Common.Utils.addScrollIfNeed('.page[data-page=settings-about-view]', '.page[data-page=settings-about-view] .page-content');
|
||||||
},
|
},
|
||||||
|
|
||||||
loadDocument: function(data) {
|
loadDocument: function(data) {
|
||||||
|
|
|
@ -93,6 +93,7 @@ define([
|
||||||
|
|
||||||
$('.chart-types .thumb').single('click', this.onTypeClick.bind(this));
|
$('.chart-types .thumb').single('click', this.onTypeClick.bind(this));
|
||||||
|
|
||||||
|
Common.Utils.addScrollIfNeed('#add-chart .pages', '#add-chart .page');
|
||||||
me.initControls();
|
me.initControls();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -89,6 +89,7 @@ define([
|
||||||
.on('click', '.function > a', this.onFunctionClick.bind(this));
|
.on('click', '.function > a', this.onFunctionClick.bind(this));
|
||||||
$('.groups a.group').single('click', this.onGroupClick.bind(this));
|
$('.groups a.group').single('click', this.onGroupClick.bind(this));
|
||||||
|
|
||||||
|
Common.Utils.addScrollIfNeed('#add-formula .pages', '#add-formula .page');
|
||||||
me.initControls();
|
me.initControls();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -181,10 +182,12 @@ define([
|
||||||
groupname : this.groups[group],
|
groupname : this.groups[group],
|
||||||
functions : items
|
functions : items
|
||||||
});
|
});
|
||||||
|
Common.Utils.addScrollIfNeed('.view.add-root-view .page-on-center', '.view.add-root-view .page-on-center .page-content');
|
||||||
},
|
},
|
||||||
|
|
||||||
openFunctionInfo: function (type) {
|
openFunctionInfo: function (type) {
|
||||||
_openView.call(this, 'info', this.functions[type]);
|
_openView.call(this, 'info', this.functions[type]);
|
||||||
|
Common.Utils.addScrollIfNeed('.view.add-root-view .page-on-center', '.view.add-root-view .page-on-center .page-content');
|
||||||
},
|
},
|
||||||
|
|
||||||
textGroups: 'CATEGORIES',
|
textGroups: 'CATEGORIES',
|
||||||
|
|
|
@ -89,6 +89,8 @@ define([
|
||||||
cfgLink.internal = { sheet: {index: index, caption: caption}};
|
cfgLink.internal = { sheet: {index: index, caption: caption}};
|
||||||
// me.fireEvent('link:changesheet', [me, $(e.currentTarget).val()]);
|
// me.fireEvent('link:changesheet', [me, $(e.currentTarget).val()]);
|
||||||
}).val(cfgLink.internal.sheet.index);
|
}).val(cfgLink.internal.sheet.index);
|
||||||
|
|
||||||
|
Common.Utils.addScrollIfNeed('.page[data-page=add-link]', '.page[data-page=add-link] .page-content');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -105,6 +107,7 @@ define([
|
||||||
|
|
||||||
initEvents: function () {
|
initEvents: function () {
|
||||||
var me = this;
|
var me = this;
|
||||||
|
|
||||||
me.initControls();
|
me.initControls();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -63,6 +63,7 @@ define([
|
||||||
},
|
},
|
||||||
|
|
||||||
initEvents: function () {
|
initEvents: function () {
|
||||||
|
Common.Utils.addScrollIfNeed('#add-shape .pages', '#add-shape .page');
|
||||||
this.initControls();
|
this.initControls();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -78,6 +78,7 @@ define([
|
||||||
$('#text-color').single('click', _.bind(me.showTextColor, me));
|
$('#text-color').single('click', _.bind(me.showTextColor, me));
|
||||||
$('#fill-color').single('click', _.bind(me.showFillColor, me));
|
$('#fill-color').single('click', _.bind(me.showFillColor, me));
|
||||||
|
|
||||||
|
Common.Utils.addScrollIfNeed('#edit-cell .pages', '#edit-cell .page');
|
||||||
me.initControls();
|
me.initControls();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -161,6 +162,10 @@ define([
|
||||||
return selector + ' a.item-link[data-page]';
|
return selector + ' a.item-link[data-page]';
|
||||||
}).join(', ');
|
}).join(', ');
|
||||||
|
|
||||||
|
Common.Utils.addScrollIfNeed('.page[data-page=edit-border-style]', '.page[data-page=edit-border-style] .page-content');
|
||||||
|
Common.Utils.addScrollIfNeed('.page[data-page=edit-cell-format]', '.page[data-page=edit-cell-format] .page-content');
|
||||||
|
Common.Utils.addScrollIfNeed('.page[data-page=edit-text-format]', '.page[data-page=edit-text-format] .page-content');
|
||||||
|
|
||||||
$(selectorsDynamicPage).single('click', _.bind(this.onItemClick, this));
|
$(selectorsDynamicPage).single('click', _.bind(this.onItemClick, this));
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -224,6 +229,8 @@ define([
|
||||||
}, 100));
|
}, 100));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Common.Utils.addScrollIfNeed('.page[data-page=edit-text-font-page]', '.page[data-page=edit-text-font-page] .page-content');
|
||||||
},
|
},
|
||||||
|
|
||||||
showTextColor: function () {
|
showTextColor: function () {
|
||||||
|
@ -232,7 +239,8 @@ define([
|
||||||
this.paletteTextColor = new Common.UI.ThemeColorPalette({
|
this.paletteTextColor = new Common.UI.ThemeColorPalette({
|
||||||
el: $('.page[data-page=edit-text-color] .page-content')
|
el: $('.page[data-page=edit-text-color] .page-content')
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Common.Utils.addScrollIfNeed('.page[data-page=edit-text-color]', '.page[data-page=edit-text-color] .page-content');
|
||||||
this.fireEvent('page:show', [this, '#edit-text-color']);
|
this.fireEvent('page:show', [this, '#edit-text-color']);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -244,6 +252,7 @@ define([
|
||||||
transparent: true
|
transparent: true
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Common.Utils.addScrollIfNeed('.page[data-page=edit-fill-color]', '.page[data-page=edit-fill-color] .page-content');
|
||||||
this.fireEvent('page:show', [this, '#edit-fill-color']);
|
this.fireEvent('page:show', [this, '#edit-fill-color']);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -101,6 +101,8 @@ define([
|
||||||
|
|
||||||
me.updateItemHandlers();
|
me.updateItemHandlers();
|
||||||
me.initControls();
|
me.initControls();
|
||||||
|
|
||||||
|
Common.Utils.addScrollIfNeed('#edit-chart .pages', '#edit-chart .page');
|
||||||
},
|
},
|
||||||
|
|
||||||
// Render layout
|
// Render layout
|
||||||
|
|
|
@ -69,6 +69,7 @@ define([
|
||||||
initEvents: function () {
|
initEvents: function () {
|
||||||
var me = this;
|
var me = this;
|
||||||
|
|
||||||
|
Common.Utils.addScrollIfNeed('#edit-link .pages', '#edit-link .page');
|
||||||
me.initControls();
|
me.initControls();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -70,6 +70,7 @@ define([
|
||||||
|
|
||||||
$('.edit-shape-style .categories a').single('click', _.bind(me.showStyleCategory, me));
|
$('.edit-shape-style .categories a').single('click', _.bind(me.showStyleCategory, me));
|
||||||
|
|
||||||
|
Common.Utils.addScrollIfNeed('#edit-shape .pages', '#edit-shape .page');
|
||||||
me.updateItemHandlers();
|
me.updateItemHandlers();
|
||||||
me.initControls();
|
me.initControls();
|
||||||
},
|
},
|
||||||
|
@ -118,6 +119,7 @@ define([
|
||||||
return selector + ' a.item-link[data-page]';
|
return selector + ' a.item-link[data-page]';
|
||||||
}).join(', ');
|
}).join(', ');
|
||||||
|
|
||||||
|
Common.Utils.addScrollIfNeed('.page[data-page=edit-shape-border-color-view]', '.page[data-page=edit-shape-border-color-view] .page-content');
|
||||||
$(selectorsDynamicPage).single('click', _.bind(this.onItemClick, this));
|
$(selectorsDynamicPage).single('click', _.bind(this.onItemClick, this));
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -162,6 +164,10 @@ define([
|
||||||
if (!this.isShapeCanFill)
|
if (!this.isShapeCanFill)
|
||||||
this.showStyleCategory();
|
this.showStyleCategory();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Common.Utils.addScrollIfNeed('.page[data-page=edit-shape-style]', '.page[data-page=edit-shape-style] .page-content');
|
||||||
|
Common.Utils.addScrollIfNeed('.page[data-page=edit-shape-replace]', '.page[data-page=edit-shape-replace] .page-content');
|
||||||
|
Common.Utils.addScrollIfNeed('.page[data-page=edit-shape-reorder]', '.page[data-page=edit-shape-reorder] .page-content');
|
||||||
},
|
},
|
||||||
|
|
||||||
textStyle: 'Style',
|
textStyle: 'Style',
|
||||||
|
|
|
@ -257,6 +257,7 @@
|
||||||
Object.defineProperty(navigator, 'userAgent', {
|
Object.defineProperty(navigator, 'userAgent', {
|
||||||
get: function () { return ua; }
|
get: function () { return ua; }
|
||||||
});
|
});
|
||||||
|
document.write('<script type="text/javascript" src="../../../vendor/iscroll/iscroll.js"><\/script>');
|
||||||
}
|
}
|
||||||
|
|
||||||
window.sdk_dev_scrpipts.forEach(function(item){
|
window.sdk_dev_scrpipts.forEach(function(item){
|
||||||
|
|
|
@ -191,6 +191,7 @@
|
||||||
Object.defineProperty(navigator, 'userAgent', {
|
Object.defineProperty(navigator, 'userAgent', {
|
||||||
get: function () { return ua; }
|
get: function () { return ua; }
|
||||||
});
|
});
|
||||||
|
document.write('<script type="text/javascript" src="../../../vendor/iscroll/iscroll.js"><\/script>');
|
||||||
}
|
}
|
||||||
|
|
||||||
function getUrlParams() {
|
function getUrlParams() {
|
||||||
|
|
Loading…
Reference in a new issue