web/data/cubicweb.bookmarks.js
author Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
Mon, 21 Sep 2009 15:55:40 +0200
branchstable
changeset 3342 8b30ae9c4e67
parent 1419 7ff24154351d
permissions -rw-r--r--
[javascript] make inlinedform-added event bindable $(form).trigger('inlinedform-added') was not usable since form had no existence outside the inner callback. Use the general CubicWeb object to trigger the event so it's easy to bind a callback wherever it's needed.

CubicWeb.require('ajax.js');

function removeBookmark(beid) {
    d = asyncRemoteExec('delete_bookmark', beid);
    d.addCallback(function(boxcontent) {
	    reloadComponent('bookmarks_box', '', 'boxes', 'bookmarks_box');
  	document.location.hash = '#header';
 	updateMessage(_("bookmark has been removed"));
    });
}