mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-06-28 08:50:06 +02:00
BOOYAH BABY FIRST BACKBONE VIEW REMOVED REACT FTW
This commit is contained in:
parent
a7b23e0342
commit
d4e0887bc7
7 changed files with 128 additions and 184 deletions
|
@ -201,20 +201,13 @@ var Command = Backbone.Model.extend({
|
|||
},
|
||||
|
||||
addWarning: function(msg) {
|
||||
console.log('this is the warning', msg);
|
||||
this.get('warnings').push(msg);
|
||||
// change numWarnings so the change event fires. This is bizarre -- Backbone can't
|
||||
// detect if an array changes, so adding an element does nothing
|
||||
this.set('numWarnings', this.get('numWarnings') ? this.get('numWarnings') + 1 : 1);
|
||||
},
|
||||
|
||||
getFormattedWarnings: function() {
|
||||
if (!this.get('warnings').length) {
|
||||
return '';
|
||||
}
|
||||
var i = '<i class="icon-exclamation-sign"></i>';
|
||||
return '<p>' + i + this.get('warnings').join('</p><p>' + i) + '</p>';
|
||||
},
|
||||
|
||||
parseOrCatch: function() {
|
||||
this.expandShortcuts(this.get('rawStr'));
|
||||
try {
|
||||
|
@ -253,7 +246,7 @@ var Command = Backbone.Model.extend({
|
|||
},
|
||||
|
||||
formatError: function() {
|
||||
this.set('result', this.get('error').toResult());
|
||||
this.set('result', this.get('error').getMsg());
|
||||
},
|
||||
|
||||
expandShortcuts: function(str) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue