Skip to content

Commit

Permalink
#29 added force option [temporary]
Browse files Browse the repository at this point in the history
  • Loading branch information
itayw committed Mar 10, 2014
1 parent da99692 commit 4349d43
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions bin/joola.io.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,15 +257,16 @@ if (joolaio.options.APIToken) {
joolaio.init({});
}

joolaio.set = function (key, value) {
joolaio.set = function (key, value, callback) {
joolaio.options[key] = value;

if (key === 'APIToken') {
joolaio.dispatch.users.verifyAPIToken(joolaio.options.APIToken, function (err, user) {
if (err)
throw err;
return callback(err);

joolaio.USER = user;
return callback(null);
});
}
};
Expand Down Expand Up @@ -3873,7 +3874,7 @@ joolaio.events.on('core.init.finish', function () {
$.fn.Sparkline = function (options, callback) {
var result = null;
var uuid = this.attr('jio-uuid');
if (!uuid) {
if (!uuid || options.force) {
//create new
if (!options)
options = {};
Expand Down
2 changes: 1 addition & 1 deletion lib/viz/Sparkline.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ joolaio.events.on('core.init.finish', function () {
$.fn.Sparkline = function (options, callback) {
var result = null;
var uuid = this.attr('jio-uuid');
if (!uuid) {
if (!uuid || options.force) {
//create new
if (!options)
options = {};
Expand Down

0 comments on commit 4349d43

Please sign in to comment.