Skip to content

Commit

Permalink
Add method to update options in bulk
Browse files Browse the repository at this point in the history
  • Loading branch information
jhdavids8 committed Dec 8, 2014
1 parent 3594f50 commit 33a0f0b
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
13 changes: 13 additions & 0 deletions build/please-wait.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,19 @@
}
};

PleaseWait.prototype.updateOptions = function(options) {
var k, v, _results;
if (options == null) {
options = {};
}
_results = [];
for (k in options) {
v = options[k];
_results.push(this.updateOption(k, v));
}
return _results;
};

PleaseWait.prototype.updateLoadingHtml = function(loadingHtml, immediately) {
if (immediately == null) {
immediately = false;
Expand Down
2 changes: 1 addition & 1 deletion build/please-wait.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions src/please-wait.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,10 @@
else
throw new Error("Unknown option '#{option}'")

updateOptions: (options={}) ->
for k, v of options
@updateOption(k, v)

updateLoadingHtml: (loadingHtml, immediately=false) ->
unless @_loadingHtmlElem? then throw new Error("The loading template does not have an element of class 'pg-loading-html'")
if immediately
Expand Down

0 comments on commit 33a0f0b

Please sign in to comment.