mirror of
https://github.com/piskelapp/piskel.git
synced 2023-08-10 21:12:52 +03:00
Issue #446: store selected export tab in user preferences
This commit is contained in:
parent
c63c764060
commit
2f295825f2
@ -20,8 +20,6 @@
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
var DEFAULT_TAB = 'png';
|
|
||||||
|
|
||||||
ns.ExportController = function (piskelController) {
|
ns.ExportController = function (piskelController) {
|
||||||
this.piskelController = piskelController;
|
this.piskelController = piskelController;
|
||||||
this.onSizeInputChange_ = this.onSizeInputChange_.bind(this);
|
this.onSizeInputChange_ = this.onSizeInputChange_.bind(this);
|
||||||
@ -53,7 +51,8 @@
|
|||||||
this.exportTabs = document.querySelector('.export-tabs');
|
this.exportTabs = document.querySelector('.export-tabs');
|
||||||
this.addEventListener(this.exportTabs, 'click', this.onTabsClicked_);
|
this.addEventListener(this.exportTabs, 'click', this.onTabsClicked_);
|
||||||
|
|
||||||
this.selectTab(DEFAULT_TAB);
|
var tab = pskl.UserSettings.get(pskl.UserSettings.EXPORT_TAB);
|
||||||
|
this.selectTab(tab);
|
||||||
};
|
};
|
||||||
|
|
||||||
ns.ExportController.prototype.destroy = function () {
|
ns.ExportController.prototype.destroy = function () {
|
||||||
@ -75,6 +74,7 @@
|
|||||||
this.currentController = new tabs[tabId].controller(this.piskelController, this);
|
this.currentController = new tabs[tabId].controller(this.piskelController, this);
|
||||||
this.currentController.init();
|
this.currentController.init();
|
||||||
this.currentTab = tabId;
|
this.currentTab = tabId;
|
||||||
|
pskl.UserSettings.set(pskl.UserSettings.EXPORT_TAB, tabId);
|
||||||
|
|
||||||
var selectedTab = this.exportTabs.querySelector('.selected');
|
var selectedTab = this.exportTabs.querySelector('.selected');
|
||||||
if (selectedTab) {
|
if (selectedTab) {
|
||||||
|
@ -13,6 +13,7 @@
|
|||||||
LAYER_PREVIEW : 'LAYER_PREVIEW',
|
LAYER_PREVIEW : 'LAYER_PREVIEW',
|
||||||
LAYER_OPACITY : 'LAYER_OPACITY',
|
LAYER_OPACITY : 'LAYER_OPACITY',
|
||||||
EXPORT_SCALING: 'EXPORT_SCALING',
|
EXPORT_SCALING: 'EXPORT_SCALING',
|
||||||
|
EXPORT_TAB: 'EXPORT_TAB',
|
||||||
PEN_SIZE : 'PEN_SIZE',
|
PEN_SIZE : 'PEN_SIZE',
|
||||||
RESIZE_SETTINGS: 'RESIZE_SETTINGS',
|
RESIZE_SETTINGS: 'RESIZE_SETTINGS',
|
||||||
KEY_TO_DEFAULT_VALUE_MAP_ : {
|
KEY_TO_DEFAULT_VALUE_MAP_ : {
|
||||||
@ -30,6 +31,7 @@
|
|||||||
'LAYER_OPACITY' : 0.2,
|
'LAYER_OPACITY' : 0.2,
|
||||||
'LAYER_PREVIEW' : true,
|
'LAYER_PREVIEW' : true,
|
||||||
'EXPORT_SCALING' : 1,
|
'EXPORT_SCALING' : 1,
|
||||||
|
'EXPORT_TAB' : 'png',
|
||||||
'PEN_SIZE' : 1,
|
'PEN_SIZE' : 1,
|
||||||
'RESIZE_SETTINGS': {
|
'RESIZE_SETTINGS': {
|
||||||
maintainRatio : true,
|
maintainRatio : true,
|
||||||
|
Loading…
Reference in New Issue
Block a user