Lots o refactor

This commit is contained in:
Max Lynch
2015-11-28 18:26:55 -06:00
parent 044a824f29
commit 5b754390f5
35 changed files with 653 additions and 356 deletions
+11 -2
View File
@@ -33,7 +33,6 @@ export class Plugin {
}
doMethod(method) {
let pluginMethodArgEntry = demoArgs[this.plugin];
let args = [];
@@ -41,9 +40,19 @@ export class Plugin {
args = pluginMethodArgEntry[method] || [];
}
Toast.showWithOptions({
message: 'Doing ' + this.plugin.name + '.' + method + '()',
duration: "short",
position: "bottom",
addPixelsY: -40 // added a negative value to move it up a bit (default 0)
});
console.log('Doing method', method, 'on Plugin', this.plugin, 'args:', args);
// TODO: Pass args
this.plugin[method].apply(this.plugin, args);
this.plugin[method].apply(this.plugin, args).then(() => {
console.log('Success', arguments);
}, (err) => {
console.error('Error', err);
});
}
}