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
define([ | |
'backbone', | |
], function(Backbone){ | |
Backbone.LayoutManager.configure({ | |
// Override render to use Handlebars | |
render: function(template, context) { | |
return Handlebars.compile(template)(context); | |
}, | |
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
(function() { | |
var Events = { | |
dropMenu: function(evt) { | |
alert("Handle the click"); | |
}, | |
events: { | |
"click .drop-menu": "dropMenu", | |
}, | |
} | |
return Events; |
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
//events | |
define([ | |
"namespace", | |
// Libs | |
"use!backbone", | |
// Plugins | |
"use!plugins/backbone.layoutmanager", | |
], |
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
obj.Views.SubMenu = Backbone.LayoutManager.View.extend({ | |
tagName: "ul", | |
template: "home/manage/menuSub1", | |
}); | |
// Event Method: | |
subMenu: function(evt) { | |
$(evt.target).append(new obj.Views.SubMenu().render()); | |
} |
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
UploadModal = new Module.Views.LogoModal; | |
DeleteModal = new Module.Views.DeleteModal; | |
AddModal = new Module.Views.AddModal; | |
layout.view("#content", new Module.Views.Main({ | |
views: { | |
'#Modals' : [UploadModal, DeleteModal, AddModal] | |
} |
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
initialize: function() { | |
if (!this.get("content")) { | |
this.set({"content": this.defaults.content}); | |
} | |
}, |
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
Backbone.LayoutManager.configure({ | |
paths: { | |
layout: "//app/layouts/", | |
template: "//app/templates/" | |
}, | |
fetch: function(path) { | |
path = path + ".html"; | |
path = path.slice(1); |
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
render: function(layout) { | |
var view = layout(this); | |
var themeId = this.options.themeId; | |
/* THIS WORKS, BUT WHY DO I NEED TO LOOP THE COLLECTION?!?! */ | |
this.collection.each(function(theme) { | |
if (theme.id == themeId) { | |
console.log('theme: ', theme); | |
view.insert(new ThemeEditor.Views.PreviewContent({ | |
model: theme |
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
$(window).on('beforeunload', function(e) { | |
//confirm('UNLOAD', 'UNLOAD'); | |
e.preventDefault(); | |
//e.stopPropagation(); | |
console.log('page navigation cancelled'); | |
//debugger; | |
return 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
// now that we have the initial interface built, lets run a search | |
HeaderView = Backbone.Views.extend({ | |
template: 'template/path/here', | |
events: { | |
"click #searchButton": "search" | |
}, | |
search: function(e) { |
OlderNewer