master
Nick Sergeant 2012-01-15 20:08:35 -05:00
parent 5c9c0bff29
commit 4ad8831b86
1 changed files with 16 additions and 3 deletions

View File

@ -933,6 +933,13 @@ jQuery(function($) {
SniptList = new SniptListView({ 'snipts': this.$snipts }); SniptList = new SniptListView({ 'snipts': this.$snipts });
} }
// Search
this.$search_query.focus(function() {
if (window.$selected) {
$selected.trigger('deselect');
}
});
}, },
keyboardShortcuts: function() { keyboardShortcuts: function() {
@ -951,7 +958,9 @@ jQuery(function($) {
}); });
}, },
inFieldLabels: function () { inFieldLabels: function () {
$('div.infield label', this.el).inFieldLabels(); $('div.infield label', this.el).inFieldLabels({
fadeDuration: 200
});
} }
}); });
@ -989,6 +998,7 @@ jQuery(function($) {
'click .container': 'clickSelect', 'click .container': 'clickSelect',
'copy': 'copy', 'copy': 'copy',
'detail': 'detail', 'detail': 'detail',
'deselect': 'deselect',
'expand': 'expand', 'expand': 'expand',
'next': 'next', 'next': 'next',
'prev': 'prev', 'prev': 'prev',
@ -1010,6 +1020,10 @@ jQuery(function($) {
window.prompt('Text is selected. To copy: press ' + cmd + '+C then <Enter>', this.$raw.text()); window.prompt('Text is selected. To copy: press ' + cmd + '+C then <Enter>', this.$raw.text());
return false; return false;
}, },
deselect: function() {
this.$el.removeClass('selected');
window.$selected = false;
},
detail: function() { detail: function() {
window.location = this.model.get('url'); window.location = this.model.get('url');
}, },
@ -1084,8 +1098,7 @@ jQuery(function($) {
}); });
$(document).bind('keydown', 'esc', function() { $(document).bind('keydown', 'esc', function() {
if ($selected) { if ($selected) {
$selected.removeClass('selected'); $selected.trigger('deselect');
$selected = false;
} }
}); });
$(document).bind('keydown', 'j', function() { $(document).bind('keydown', 'j', function() {