Skip to content
This repository has been archived by the owner on Apr 16, 2019. It is now read-only.

Commit

Permalink
build v0.0.6
Browse files Browse the repository at this point in the history
  • Loading branch information
Derick Bailey committed Sep 4, 2013
1 parent cca753c commit faa4503
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 12 deletions.
34 changes: 25 additions & 9 deletions build/web/kendo.backbone.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Kendo-Backbone
// --------------
// v0.0.5
// v0.0.6
//
// Copyright (c)2013 Telerik. All Rights Reserved.
// Distributed under Apache 2.0 license
Expand Down Expand Up @@ -312,29 +312,45 @@ kendo.Backbone.DataSource = (function($, kendo, _) {

kendo.Backbone.ViewEvents = (function($, kendo, Backbone, _) {
var eventSplitter = /^(\S+)\s*(.*)$/;
var eventConfigName = "kendoUIEvents";

var m;

var ViewEvents = {

delegate: function(view) {
var webEvents = _.result(view, 'kendoUIWeb');
if (webEvents){
this._delegateEvents(view, webEvents, kendo.ui);
}
this._processEvents(view, function(widget, eventName, method){
m = method;
widget.bind(eventName, method);
});
},

undelegate: function(view){
this._processEvents(view, function(widget, eventName, method){
widget.unbind(eventName);
});
},

_delegateEvents: function(view, events, namespace){
_processEvents: function(view, cb){
var events = _.result(view, eventConfigName);
if (!events){ return; }

for (var key in events) {
var method = events[key];

if (!_.isFunction(method)) { method = view[events[key]]; }
if (!_.isFunction(method)) { method = view[method]; }
if (!method) { continue; }

var match = key.match(eventSplitter);
var eventName = match[1], selector = match[2];
method = _.bind(method, view);

var widget = kendo.widgetInstance(view.$(selector), kendo.ui);
widget.bind(eventName, method);
var element = view.$(selector);
var widget = kendo.widgetInstance(element, kendo.ui) ||
kendo.widgetInstance(element, kendo.mobile.ui) ||
kendo.widgetInstance(element, kendo.dataviz.ui);

cb.call(this, widget, eventName, method);
}
}
};
Expand Down
2 changes: 1 addition & 1 deletion build/web/kendo.backbone.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions build/web/kendo.backbone.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit faa4503

Please sign in to comment.