-
-
Save xjamundx/5033788 to your computer and use it in GitHub Desktop.
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(function(require) { | |
var Backbone = require('backbone') | |
var template = require('text!../../template/newThread.html') | |
return Backbone.View.extend({ | |
el: '#container', | |
template: _.template(template), | |
initialize: function () { | |
this.render() | |
var Contact = require('model/contact') | |
var Contacts = require('collection/contacts') | |
var ContactList = new Contacts([ | |
{"name": "backbone-autocomplete"}, | |
{"name": "backbone-memento"}, | |
{"name": "backbone-validations"}, | |
{"name": "backbone-chosen"}, | |
{"name": "backbone-relational"}, | |
{"name": "backbone-bindings"}, | |
{"name": "backbone-boilerplate"}, | |
{"name": "backbone-traversal"}, | |
{"name": "backbone-factory"}, | |
{"name": "jquery"}, | |
{"name": "jquery-ui"}, | |
{"name": "angular.js"}, | |
{"name": "keymaster.js"} | |
]) | |
console.log(ContactList); | |
var view = new AutoCompleteView({ | |
input: $("#to"), | |
model: ContactList, | |
onSelect: function (model) { | |
alert('zia') | |
} | |
}) | |
console.log(view, view.input, view.$el, view.el, view.input.outerWidth()); | |
view.render() | |
console.log(view, view.input, view.$el, view.el, view.input.outerWidth()); | |
}, | |
render: function() { | |
alert('rendering') | |
this.$el.html(this.template({})); | |
return this; | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment