Deselect and match transition speed

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

View File

@ -19,6 +19,13 @@
SniptList = new SniptListView({ 'snipts': this.$snipts });
}
// Search
this.$search_query.focus(function() {
if (window.$selected) {
$selected.trigger('deselect');
}
});
},
keyboardShortcuts: function() {
@ -37,7 +44,9 @@
});
},
inFieldLabels: function () {
$('div.infield label', this.el).inFieldLabels();
$('div.infield label', this.el).inFieldLabels({
fadeDuration: 200
});
}
});

View File

@ -27,6 +27,7 @@
'click .container': 'clickSelect',
'copy': 'copy',
'detail': 'detail',
'deselect': 'deselect',
'expand': 'expand',
'next': 'next',
'prev': 'prev',
@ -48,6 +49,10 @@
window.prompt('Text is selected. To copy: press ' + cmd + '+C then <Enter>', this.$raw.text());
return false;
},
deselect: function() {
this.$el.removeClass('selected');
window.$selected = false;
},
detail: function() {
window.location = this.model.get('url');
},
@ -122,8 +127,7 @@
});
$(document).bind('keydown', 'esc', function() {
if ($selected) {
$selected.removeClass('selected');
$selected = false;
$selected.trigger('deselect');
}
});
$(document).bind('keydown', 'j', function() {