mirror of
https://github.com/chinchang/web-maker.git
synced 2025-07-16 03:26:19 +02:00
save layout settings.
This commit is contained in:
@ -128,7 +128,7 @@
|
|||||||
.mode-btn svg {
|
.mode-btn svg {
|
||||||
width: 20px;
|
width: 20px;
|
||||||
height: 20px;
|
height: 20px;
|
||||||
fill: rgba(255, 255, 255, 0.09)
|
fill: rgba(255, 255, 255, 0.2)
|
||||||
}
|
}
|
||||||
.mode-btn:hover svg,
|
.mode-btn:hover svg,
|
||||||
.mode-btn.selected svg {
|
.mode-btn.selected svg {
|
||||||
|
14
script.js
14
script.js
@ -118,11 +118,17 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
function init () {
|
function init () {
|
||||||
layoutBtn1.addEventListener('click', function () { toggleLayout(1) });
|
layoutBtn1.addEventListener('click', function () { saveSetting('layoutMode', 1); toggleLayout(1); });
|
||||||
layoutBtn2.addEventListener('click', function () { toggleLayout(2) });
|
layoutBtn2.addEventListener('click', function () { saveSetting('layoutMode', 2); toggleLayout(2); });
|
||||||
layoutBtn3.addEventListener('click', function () { toggleLayout(3) });
|
layoutBtn3.addEventListener('click', function () { saveSetting('layoutMode', 3); toggleLayout(3); });
|
||||||
|
|
||||||
toggleLayout(3);
|
chrome.storage.local.get('layoutMode', function localGetCallback(result) {
|
||||||
|
if (result.layoutMode) {
|
||||||
|
toggleLayout(result.layoutMode);
|
||||||
|
} else {
|
||||||
|
toggleLayout(1);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
function attachResizeListners () {
|
function attachResizeListners () {
|
||||||
function mouseMoveListener (e) {
|
function mouseMoveListener (e) {
|
||||||
|
Reference in New Issue
Block a user