mirror of
https://github.com/Pathduck/gallery3.git
synced 2026-06-16 06:59:55 -04:00
Create the concept of an "ajax link" and use it for thumbnail rotation
and album covers in the context menu. Notes: - This requires context_menu() to have a CSS selector that refers to the <img> that we're operating on, otherwise we don't know how to find the thumbnail, etc. - Create Menu_Element_Ajax_Link which has an ajax_handler attribute that contains a snippet of JS that we're going to run when the ajax call returns. - Add $.gallery_replace_image in gallery.common.js - Add lib/gallery.ajax.js which can be used to ajaxify any link, and have ui.init.js in the themes call that on all .gAjaxLink elements.
This commit is contained in:
@@ -111,15 +111,15 @@ class Theme_View_Core extends Gallery_View {
|
||||
return $menu->compact();
|
||||
}
|
||||
|
||||
public function context_menu($item) {
|
||||
public function context_menu($item, $thumbnail_css_selector) {
|
||||
$menu = Menu::factory("root")
|
||||
->append(Menu::factory("submenu")
|
||||
->id("context_menu")
|
||||
->label(t("Options")))
|
||||
->css_class("gContextMenu");
|
||||
|
||||
gallery::context_menu($menu, $this, $item);
|
||||
module::event("context_menu", $menu, $this, $item);
|
||||
gallery::context_menu($menu, $this, $item, $thumbnail_css_selector);
|
||||
module::event("context_menu", $menu, $this, $item, $thumbnail_css_selector);
|
||||
return $menu->compact();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user