apostrophe
Advanced tools
Comparing version 0.4.130 to 0.4.131
{ | ||
"name": "apostrophe", | ||
"version": "0.4.130", | ||
"version": "0.4.131", | ||
"description": "Apostrophe is a user-friendly content management system. This core module of Apostrophe provides rich content editing and essential facilities to integrate Apostrophe into your Express project. Apostrophe also includes simple facilities for storing your rich content areas in MongoDB and fetching them back again. Additional functionality is available in modules like apostrophe-pages, apostrophe-snippets, apostrophe-blog, apostrophe-events, apostrophe-twitter and apostrophe-rss.", | ||
@@ -66,2 +66,2 @@ "main": "./lib/apostrophe.js", | ||
"license": "MIT" | ||
} | ||
} |
@@ -94,6 +94,5 @@ /* global apos, _, confirm */ | ||
self.$search = self.$el.find('[name="search"]'); | ||
self.$search.bind('textchange', function() { | ||
self.resetIndex(); | ||
}); | ||
self.enableSearchField(); | ||
// Buttons in the show view that make sense only after an item is chosen | ||
@@ -104,2 +103,18 @@ self.$show.find('[data-edit]').hide(); | ||
self.enableSearchField = function() { | ||
// Debounce the textchange event. If we let it fire rapidly, | ||
// the second set of results may arrive before the first, with | ||
// irrational results | ||
var pending = false; | ||
self.$search.bind('textchange', function() { | ||
if (!pending) { | ||
pending = true; | ||
setTimeout(function() { | ||
self.resetIndex(); | ||
pending = false; | ||
}, 500); | ||
} | ||
}); | ||
}; | ||
self.enableUploads = function() { | ||
@@ -106,0 +121,0 @@ var $uploader = self.$el.find('[data-uploader]'); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
4376710
36739