This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var MyView = new Backbone.View.extend({ | |
render: function() { | |
$(this.el).html(this.template()); | |
} | |
}); | |
// In real code, use DOM element | |
new MyView({el: $(“#my_target”)}); | |
// In test code, use in memory element |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Global jQuery query | |
$(“#something_i_care_about”); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Scoped jQuery query | |
$(view.el).find(“#something_i_care_about”); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe("NotesView", function() { | |
beforeEach(function() { | |
var notes = new NotesCollection(); | |
spyOn(notes, "fetch"); | |
var view = new NotesView({collection: notes}); | |
}); | |
describe("#initialize", function() { | |
it("should fetch the notes", function() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for (var i = 0; i < collection.length; i++) { | |
var record = collection[i]; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
collection.each(function(record) { | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var specViewProto = jasmine.HtmlReporter.SpecView.prototype; | |
jasmine.HtmlReporter.SpecView = function(spec, dom){ | |
this.spec = spec; | |
this.dom = dom; | |
this.symbol = this.createDom('li', { className: 'pending' }); | |
this.dom.symbolSummary.appendChild(this.symbol); | |
this.detail = $("<div class='description'></div>").get(0); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"color_scheme": "Packages/Color Scheme - Default/Monokai.tmTheme", | |
"ensure_newline_at_eof_on_save": true, | |
"font_size": 16.0, | |
"save_on_focus_lost": true, | |
"tab_size": 2, | |
"translate_tabs_to_spaces": true, | |
"spell_check": true, | |
"fade_fold_buttons": true, | |
"highlight_line": false, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ "keys": ["super+shift+y"], "command": "run_macro_file", "args": {"file": "Packages/Default/Delete Line.sublime-macro"} }, | |
{ "keys": ["super+shift+n"], "command": "show_overlay", "args": {"overlay": "goto", "show_files": true} }, | |
{ "keys": ["super+y"], "command": "run_macro_file", "args": {"file": "Packages/Default/Delete Line.sublime-macro"} }, | |
{ "keys": ["super+d"], "command": "duplicate_line" }, | |
{ "keys": ["super+shift+v"], "command": "paste" }, | |
{ "keys": ["super+v"], "command": "paste_and_indent" } | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
this.destroy = function() { | |
return $target.off("scroll", _this.watchScroll); | |
}; | |
this.enableFetch = function() { | |
return fetchOn = true; | |
}; | |
this.disableFetch = function() { | |
return fetchOn = false; | |
}; |
OlderNewer