mirror of
https://github.com/piskelapp/piskel.git
synced 2023-08-10 21:12:52 +03:00
dev-environment: add ctrl+alt+R shortcut to reload styles
This commit is contained in:
parent
170a7e4731
commit
4e86fa1570
@ -201,6 +201,11 @@
|
||||
dialogId : 'unsupported-browser'
|
||||
});
|
||||
}
|
||||
|
||||
if (pskl.utils.Environment.isDebug()) {
|
||||
pskl.app.shortcutService.registerShortcut(pskl.service.keyboard.Shortcuts.DEBUG.RELOAD_STYLES,
|
||||
window.reloadStyles);
|
||||
}
|
||||
},
|
||||
|
||||
loadPiskel_ : function (piskelData) {
|
||||
|
@ -84,6 +84,10 @@
|
||||
'123456789'.split(''), '1 to 9')
|
||||
},
|
||||
|
||||
DEBUG : {
|
||||
RELOAD_STYLES : createShortcut('move-left', 'Move viewport left', 'ctrl+alt+R'),
|
||||
},
|
||||
|
||||
CATEGORIES : ['TOOL', 'SELECTION', 'MISC', 'STORAGE', 'COLOR']
|
||||
};
|
||||
})();
|
||||
|
@ -23,6 +23,10 @@
|
||||
|
||||
isIntegrationTest : function () {
|
||||
return window.location.href.indexOf('integration-test') !== -1;
|
||||
},
|
||||
|
||||
isDebug : function () {
|
||||
return window.location.href.indexOf('debug') !== -1;
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -68,12 +68,21 @@
|
||||
};
|
||||
loadScript('piskel-script-list.js', 'loadNextScript()');
|
||||
|
||||
var styles;
|
||||
window.loadStyles = function () {
|
||||
var styles = window.pskl_exports.styles;
|
||||
styles = window.pskl_exports.styles;
|
||||
for (var i = 0 ; i < styles.length ; i++) {
|
||||
loadStyle(styles[i]);
|
||||
}
|
||||
};
|
||||
|
||||
window.reloadStyles = function () {
|
||||
for (var i = 0 ; i < styles.length ; i++) {
|
||||
document.querySelector('link[href="' + styles[i] + '"]').remove();
|
||||
loadStyle(styles[i]);
|
||||
}
|
||||
};
|
||||
|
||||
loadScript('piskel-style-list.js', 'loadStyles()');
|
||||
} else {
|
||||
var script;
|
||||
|
Loading…
Reference in New Issue
Block a user