bind -> on, unbind -> off

This commit is contained in:
rolux 2012-05-28 16:10:11 +02:00
parent 81dbceb0ef
commit e477d4ee45
10 changed files with 18 additions and 18 deletions

View file

@ -210,7 +210,7 @@ appPanel
body: $('body'), body: $('body'),
document: $(document), document: $(document),
window: $(window) window: $(window)
.bind({ .on({
beforeunload: pandora.beforeunloadWindow, beforeunload: pandora.beforeunloadWindow,
resize: function() { resize: function() {
pandora.resizeWindow(); pandora.resizeWindow();

View file

@ -9,7 +9,7 @@ pandora.ui.allItems = function() {
cursor: 'default', cursor: 'default',
overflow: 'hidden' overflow: 'hidden'
}) })
.bind({ .on({
click: function() { click: function() {
that.gainFocus(); that.gainFocus();
pandora.user.ui._list && pandora.UI.set('find', {conditions: [], operator: '&'}); pandora.user.ui._list && pandora.UI.set('find', {conditions: [], operator: '&'});

View file

@ -57,7 +57,7 @@ pandora.ui.embedDialog = function(data) {
+ '" height="' + height + '" height="' + height
+ '" src="' + constructUrl(data) + '" src="' + constructUrl(data)
+ '" frameborder="0" allowfullscreen></iframe>' + '" frameborder="0" allowfullscreen></iframe>'
).bind({ ).on({
click: function() { click: function() {
this.focus(); this.focus();
this.select(); this.select();

View file

@ -39,7 +39,7 @@ pandora.ui.home = function() {
bottom: 0, bottom: 0,
width: '320px', width: '320px',
height: '160px', height: '160px',
margin: 'auto' margin: 'auto',
}) })
.appendTo(that), .appendTo(that),
$logo = $('<img>') $logo = $('<img>')
@ -57,7 +57,7 @@ pandora.ui.home = function() {
margin: 'auto', margin: 'auto',
cursor: 'pointer' cursor: 'pointer'
}) })
.bind({ .on({
click: function() { click: function() {
$browseButton.triggerEvent('click'); $browseButton.triggerEvent('click');
} }

View file

@ -57,7 +57,7 @@ pandora.ui.home = function() {
margin: 'auto', margin: 'auto',
cursor: 'pointer' cursor: 'pointer'
}) })
.bind({ .on({
click: function() { click: function() {
$browseButton.triggerEvent('click'); $browseButton.triggerEvent('click');
} }

View file

@ -65,7 +65,7 @@ pandora.ui.home = function() {
margin: '0 auto 0 auto', margin: '0 auto 0 auto',
cursor: 'pointer' cursor: 'pointer'
}) })
.bind({ .on({
click: function() { click: function() {
$browseButton.triggerEvent('click'); $browseButton.triggerEvent('click');
} }
@ -414,7 +414,7 @@ pandora.ui.home = function() {
} }
}) })
.appendTo($listsBox); .appendTo($listsBox);
$listsBox.bind({ $listsBox.on({
mouseenter: function() { mouseenter: function() {
mouse = true; mouse = true;
$('.visible').show().stop().animate({ $('.visible').show().stop().animate({
@ -454,7 +454,7 @@ pandora.ui.home = function() {
} }
} }
}; };
Ox.$document.bind({keydown: self.keydown}); Ox.$document.on({keydown: self.keydown});
lists.forEach(function(list, i) { lists.forEach(function(list, i) {
$listBox[i] = $('<div>') $listBox[i] = $('<div>')
.css({ .css({
@ -584,7 +584,7 @@ pandora.ui.home = function() {
that.remove(); that.remove();
}); });
pandora.$ui.tv && pandora.$ui.tv.unmute(); pandora.$ui.tv && pandora.$ui.tv.unmute();
self.keydown && Ox.$document.unbind({keydown: self.keydown}); self.keydown && Ox.$document.off({keydown: self.keydown});
return that; return that;
}; };

View file

@ -111,7 +111,7 @@ pandora.ui.importAnnotations = function(data) {
.css({ .css({
padding: '8px' padding: '8px'
}) })
.bind({ .on({
change: function(event) { change: function(event) {
if(this.files.length) { if(this.files.length) {
file = this.files[0]; file = this.files[0];

View file

@ -75,7 +75,7 @@ pandora.ui.listDialog = function(section) {
); );
} }
}) })
] ],
}) })
.css({ .css({
float: 'right', float: 'right',
@ -340,7 +340,7 @@ pandora.ui.listIconPanel = function(listData) {
marginTop: '16px', marginTop: '16px',
cursor: 'pointer' cursor: 'pointer'
}) })
.bind({ .on({
click: function(e) { click: function(e) {
clickIcon(e); clickIcon(e);
}, },

View file

@ -47,7 +47,7 @@ pandora.ui.uploadDialog = function(data) {
height: 128, height: 128,
removeOnClose: true, removeOnClose: true,
width: 368, width: 368,
title: 'Upload Video' title: 'Upload Video',
}) })
.bindEvent({ .bindEvent({
close: function(data) { close: function(data) {
@ -79,7 +79,7 @@ pandora.ui.uploadDialog = function(data) {
.css({ .css({
padding: '8px' padding: '8px'
}) })
.bind({ .on({
change: function(event) { change: function(event) {
if(this.files.length) { if(this.files.length) {
file = this.files[0]; file = this.files[0];

View file

@ -198,7 +198,7 @@ pandora.clickLink = function(e) {
pandora.createLinks = function($element) { pandora.createLinks = function($element) {
$element $element
.bind({ .on({
click: function() { click: function() {
return false; return false;
} }
@ -243,7 +243,7 @@ pandora.enableDragAndDrop = function($list, canMove) {
}); });
}); });
$tooltip.options({title: getTitle()}).show(data.event); $tooltip.options({title: getTitle()}).show(data.event);
canMove && Ox.UI.$window.bind({ canMove && Ox.UI.$window.on({
keydown: keydown, keydown: keydown,
keyup: keyup keyup: keyup
}); });
@ -316,7 +316,7 @@ pandora.enableDragAndDrop = function($list, canMove) {
}, },
draganddropend: function(data) { draganddropend: function(data) {
Ox.Log('', data, drag, '------------'); Ox.Log('', data, drag, '------------');
canMove && Ox.UI.$window.unbind({ canMove && Ox.UI.$window.off({
keydown: keydown, keydown: keydown,
keyup: keyup keyup: keyup
}); });