Flags :
- bookmarks OK - flaglist DEV Signed-off-by: bachy <git@g-u-i.net>
This commit is contained in:
5
js/materio_flag-ck.js
Normal file
5
js/materio_flag-ck.js
Normal file
File diff suppressed because one or more lines are too long
36
js/materio_flag.js
Normal file
36
js/materio_flag.js
Normal file
@@ -0,0 +1,36 @@
|
||||
// @codekit-prepend "gui.js"
|
||||
|
||||
(function($) {
|
||||
|
||||
MaterioFlag = function(){
|
||||
|
||||
|
||||
/**
|
||||
* init()
|
||||
*/
|
||||
function init(){
|
||||
trace('init MaterioFlag');
|
||||
$(document).bind('flagGlobalAfterLinkUpdate', onFlaging);
|
||||
};
|
||||
|
||||
function onFlaging(event){
|
||||
trace('onFlaging', event);
|
||||
|
||||
$.getJSON('/materioflag/refresh/block/bookmarks', function(json){
|
||||
trace('json', json);
|
||||
$('#block-materio-flag-materio-flag-mybookmarks').replaceWith(json.block);
|
||||
Drupal.flagLink('#block-materio-flag-materio-flag-mybookmarks');
|
||||
// TODO: update flags stars on search results after unflaging from block
|
||||
$.event.trigger('mybookmarks-block-updated');
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
init();
|
||||
|
||||
|
||||
};
|
||||
|
||||
var materioflag = new MaterioFlag();
|
||||
|
||||
})(jQuery);
|
Reference in New Issue
Block a user