1
0
mirror of https://github.com/chinchang/web-maker.git synced 2025-05-28 21:19:16 +02:00

add event for setting update.

This commit is contained in:
Kushagra Gour 2017-03-12 01:43:56 +05:30
parent 7d34b2a664
commit 406e8a83a2

View File

@ -1194,6 +1194,9 @@ onboardDontShowInTabOptionBtn, TextareaAutoComplete, savedItemCountEl */
$('[data-setting=fontSize]').value = prefs.fontSize || 16;
}
/**
* Handles all user triggered preference changes in the UI.
*/
scope.updateSetting = function updateSetting(e) {
// If this was triggered from user interaction, save the setting
if (e) {
@ -1206,6 +1209,7 @@ onboardDontShowInTabOptionBtn, TextareaAutoComplete, savedItemCountEl */
chrome.storage.sync.set(obj, function() {
alertsService.add('setting saved');
});
trackEvent('ui', 'updatePref-' + settingName, prefs[settingName]);
}
htmlCode.querySelector('.CodeMirror').style.fontSize = prefs.fontSize;
@ -1224,7 +1228,6 @@ onboardDontShowInTabOptionBtn, TextareaAutoComplete, savedItemCountEl */
// Replace correct css file in LINK tags's href
editorThemeLinkTag.href = '/lib/codemirror/theme/' + prefs.editorTheme + '.css';
scope.cm[type].setOption('keyMap', $('[data-setting=keymap]').value);
scope.cm[type].setOption('keyMap', $('[data-setting=keymap]').value);
scope.cm[type].refresh();
});