Skip to content

Instantly share code, notes, and snippets.

@Mehuge
Last active August 29, 2015 14:28
Show Gist options
  • Save Mehuge/9d4e894ea634324db404 to your computer and use it in GitHub Desktop.
Save Mehuge/9d4e894ea634324db404 to your computer and use it in GitHub Desktop.
var handleReceiveConfigVars;
cu.OnInitialized(function () {
cu.GetConfigVars(Options.activeConfigIndex);
cu.Listen('HandleReceiveConfigVars', function(configs) {
if (handleReceiveConfigVars) {
handleReceiveConfigVars(configs);
handleReceiveConfigVars = null;
}
});
});
$btnSaveDisk.click(function () {
var $container = $('#alert-container');
$container.empty();
cuAPI.SaveConfigChanges();
handleReceiveConfigVars = function (configs) {
if (configs && Options.activeConfigIndex == 2 /* KEYBIND */) {
window.localStorage.setItem('-cse-options-savedkeybinds', configs);
var $item = $('<div/>');
$('<div/>').addClass('alert-name').text('Bindings Saved To Disk').appendTo($item);
$item.appendTo($container);
}
};
cuAPI.GetConfigVars(Options.activeConfigIndex);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment