mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-06-29 17:27:22 +02:00
big scroll update
This commit is contained in:
parent
9c7ec69e2f
commit
d647d430d7
4 changed files with 40 additions and 20 deletions
|
@ -38,15 +38,18 @@ var Command = Backbone.Model.extend({
|
|||
},
|
||||
|
||||
addWarning: function(msg) {
|
||||
this.set('warnings', this.get('warnings').push(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 '';
|
||||
}
|
||||
|
||||
return '<p>' + this.get('warnings').join('</p><p>') + '</p>';
|
||||
var i = '<i class="icon-exclamation-sign"></i>';
|
||||
return '<p>' + i + this.get('warnings').join('</p><p>' + i) + '</p>';
|
||||
},
|
||||
|
||||
initialize: function() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue