diff --git a/modules/gallery/helpers/gallery_event.php b/modules/gallery/helpers/gallery_event.php index 9b3aa82da6..89ad6a4cc7 100644 --- a/modules/gallery/helpers/gallery_event.php +++ b/modules/gallery/helpers/gallery_event.php @@ -167,7 +167,7 @@ static function user_menu($menu, $theme) { } } - static function site_menu($menu, $theme) { + static function site_menu($menu, $theme, $item_css_selector) { if ($theme->page_subtype != "login") { $menu->append(Menu::factory("link") ->id("home") @@ -239,6 +239,9 @@ static function site_menu($menu, $theme) { } } + $csrf = access::csrf_token(); + $theme_item = $theme->item(); + $page_type = $theme->page_type(); if ($item->is_photo() && graphics::can("rotate")) { $options_menu ->append( @@ -247,7 +250,7 @@ static function site_menu($menu, $theme) { ->label(t("Rotate 90° counter clockwise")) ->css_class("ui-icon-rotate-ccw") ->ajax_handler("function(data) { " . - "\$.gallery_replace_image(data, \$('$thumb_css_selector')) }") + "\$.gallery_replace_image(data, \$('$item_css_selector')) }") ->url(url::site("quick/rotate/$item->id/ccw?csrf=$csrf&from_id=$theme_item->id&page_type=$page_type"))) ->append( Menu::factory("ajax_link") @@ -255,7 +258,7 @@ static function site_menu($menu, $theme) { ->label(t("Rotate 90° clockwise")) ->css_class("ui-icon-rotate-cw") ->ajax_handler("function(data) { " . - "\$.gallery_replace_image(data, \$('$thumb_css_selector')) }") + "\$.gallery_replace_image(data, \$('$item_css_selector')) }") ->url(url::site("quick/rotate/$item->id/cw?csrf=$csrf&from_id=$theme_item->id&page_type=$page_type"))); } diff --git a/modules/gallery/libraries/Theme_View.php b/modules/gallery/libraries/Theme_View.php index 8b432fb62e..6246c6f11d 100644 --- a/modules/gallery/libraries/Theme_View.php +++ b/modules/gallery/libraries/Theme_View.php @@ -86,9 +86,9 @@ public function user_menu() { return $menu->render(); } - public function site_menu() { + public function site_menu($item_css_selector) { $menu = Menu::factory("root"); - module::event("site_menu", $menu, $this); + module::event("site_menu", $menu, $this, $item_css_selector); return $menu->render(); } diff --git a/modules/gallery/models/item.php b/modules/gallery/models/item.php index 7fc3732512..409ed3cc91 100644 --- a/modules/gallery/models/item.php +++ b/modules/gallery/models/item.php @@ -674,7 +674,7 @@ public function movie_img($extra_attrs) { $v->attrs = array_merge($extra_attrs, array("style" => "display:block;width:{$this->width}px;height:{$this->height}px")); if (empty($v->attrs["id"])) { - $v->attrs["id"] = "g-movie-id-{$this->id}"; + $v->attrs["id"] = "g-item-id-{$this->id}"; } return $v; } diff --git a/themes/wind/js/ui.init.js b/themes/wind/js/ui.init.js index 6edf6be485..53b585163b 100644 --- a/themes/wind/js/ui.init.js +++ b/themes/wind/js/ui.init.js @@ -108,6 +108,9 @@ $(document).ready(function() { duration: 1000, hash: true }); + + $(this).find(".g-dialog-link").gallery_dialog(); + $(this).find(".g-ajax-link").gallery_ajax(); } // Initialize button hover effect diff --git a/themes/wind/views/movie.html.php b/themes/wind/views/movie.html.php index 27c293cef7..8481c7ce86 100644 --- a/themes/wind/views/movie.html.php +++ b/themes/wind/views/movie.html.php @@ -5,8 +5,7 @@ paginator() ?>
- movie_img(array("class" => "g-movie", "id" => "g-movie-id-{$item->id}")) ?> - context_menu($item, "#g-movie-id-{$item->id}") ?> + movie_img(array("class" => "g-movie", "id" => "g-item-id-{$item->id}")) ?>
diff --git a/themes/wind/views/page.html.php b/themes/wind/views/page.html.php index ebfbf700c6..4cc949ce27 100644 --- a/themes/wind/views/page.html.php +++ b/themes/wind/views/page.html.php @@ -89,7 +89,7 @@ diff --git a/themes/wind/views/photo.html.php b/themes/wind/views/photo.html.php index 07952c94ea..f8b5511cb1 100644 --- a/themes/wind/views/photo.html.php +++ b/themes/wind/views/photo.html.php @@ -22,7 +22,7 @@ for_html_attr() ?>"> - resize_img(array("id" => "g-photo-id-{$item->id}", "class" => "g-resize")) ?> + resize_img(array("id" => "g-item-id-{$item->id}", "class" => "g-resize")) ?>