From a6a7694211d17590bd128648316011d78705999e Mon Sep 17 00:00:00 2001 From: Harry Bomrah Date: Tue, 5 Nov 2013 13:23:18 +0800 Subject: [PATCH] gallery frontend ui fixed. --- .../assets/javascripts/galleryAPI_frontend.js.erb | 15 ++++++++++----- .../app/assets/stylesheets/gallery_frontend.css | 5 ++++- .../panel/gallery/front_end/albums_controller.rb | 11 ++++++----- .../panel/gallery/front_end/albums/index.html.erb | 2 +- .../panel/gallery/front_end/albums/show.html.erb | 2 +- 5 files changed, 22 insertions(+), 13 deletions(-) diff --git a/vendor/built_in_modules/gallery/app/assets/javascripts/galleryAPI_frontend.js.erb b/vendor/built_in_modules/gallery/app/assets/javascripts/galleryAPI_frontend.js.erb index 0290b50a2..25e8a735d 100644 --- a/vendor/built_in_modules/gallery/app/assets/javascripts/galleryAPI_frontend.js.erb +++ b/vendor/built_in_modules/gallery/app/assets/javascripts/galleryAPI_frontend.js.erb @@ -220,14 +220,19 @@ var galleryAPI = function(){ $img.fadeOut(200,function(){ g.loadstart(); - if($rslide.hasClass("fullscreen")) + if($rslide.hasClass("fullscreen")){ + $img.attr({"src":dom.attr("data-content")}).css("height","100%").load(function(){ g.loadcomplete(); $img.fadeIn(200); }); - else - $img.attr({"src":dom.attr("data-content")}).css("height","auto"); - + }else{ + $img.attr({"src":dom.attr("data-content")}).css("height","auto").load(function(){ + console.log(dom.attr("data-content")); + g.loadcomplete(); + $img.fadeIn(200); + });; + } if($rslide.hasClass("fullscreen")){ $img.css({"padding":($rslide.height()-$img.height())/2}) } @@ -236,7 +241,7 @@ var galleryAPI = function(){ if(rcom.getInternetExplorerVersion() == -1){ if(pageurl!=window.location){ - pageurl = "gallery?id="+pageurl+"&controller_action=theater"; + pageurl = window.location.pathname.replace("/","")+"?id="+pageurl+"&controller_action=theater"; window.history.pushState({path:pageurl},'',pageurl); } }else{ diff --git a/vendor/built_in_modules/gallery/app/assets/stylesheets/gallery_frontend.css b/vendor/built_in_modules/gallery/app/assets/stylesheets/gallery_frontend.css index f449178d5..c8cbef814 100644 --- a/vendor/built_in_modules/gallery/app/assets/stylesheets/gallery_frontend.css +++ b/vendor/built_in_modules/gallery/app/assets/stylesheets/gallery_frontend.css @@ -144,6 +144,9 @@ -moz-transition: all 0.3s ease; } .rslide.fullscreen { position: fixed; z-index: 99; } +.rslide.fullscreen .comp img{ + width: auto; +} .rslideinside { } .comp { @@ -156,7 +159,7 @@ -webkit-transition: all 0.3s ease; -moz-transition: all 0.3s ease; } -.comp img{ display: block; width: auto; height: auto; margin: 0 auto; cursor: pointer; min-height: 250px; } +.comp img{ display: block; width: 100%; height: auto; margin: 0 auto; cursor: pointer; min-height: 250px; } .comp .full{ width: auto; height: auto; max-width: 100%; max-height: 100%; } .rslidenav { position: absolute; diff --git a/vendor/built_in_modules/gallery/app/controllers/panel/gallery/front_end/albums_controller.rb b/vendor/built_in_modules/gallery/app/controllers/panel/gallery/front_end/albums_controller.rb index 3924ab7e1..47795b705 100644 --- a/vendor/built_in_modules/gallery/app/controllers/panel/gallery/front_end/albums_controller.rb +++ b/vendor/built_in_modules/gallery/app/controllers/panel/gallery/front_end/albums_controller.rb @@ -25,7 +25,7 @@ class Panel::Gallery::FrontEnd::AlbumsController < OrbitWidgetController end else @categoryids.each do |id| - category = GalleryCategory.find(id) + category = Category.find(id) if @tags if @tags.kind_of?(Array) @tags.each do |tag| @@ -44,8 +44,9 @@ class Panel::Gallery::FrontEnd::AlbumsController < OrbitWidgetController @albs = Array.new album.each do |values| tags = Tag.find(values.tagged_ids).map{|t| t.name} - category = GalleryCategory.find(values.gallery_category_id).name - @albs << {"_id"=>values.id,"show_path"=>panel_gallery_front_end_album_path(values),"cover"=>values.cover,"cover_path"=>values.cover_path,"description"=>values.description,"category_name"=>category,"gallery_category_id" => values.gallery_category_id,"name"=>values.name,"tag_ids"=>values.tag_ids,"tag_names"=>tags} + category = Category.find(values.category_id).title + + @albs << {"_id"=>values.id,"show_path"=>panel_gallery_front_end_album_path(values),"cover"=>values.cover,"cover_path"=>values.cover_path,"description"=>values.description,"category_name"=>category,"gallery_category_id" => values.category_id,"name"=>values.name,"tag_ids"=>values.tag_ids,"tag_names"=>tags} end @output << @albs end @@ -85,8 +86,8 @@ class Panel::Gallery::FrontEnd::AlbumsController < OrbitWidgetController @albumid = @image.gallery_album_id @album = GalleryAlbum.find(@albumid) @images = @album.gallery_images.all - tags = @album.tag_ids - @tagnames = Tag.find(tags.tagged_ids).map{|t| t.name} + tags = @album.tagged_ids + @tagnames = Tag.find(tags).map{|t| t.name} @back_link = panel_gallery_front_end_album_path(@albumid) end end diff --git a/vendor/built_in_modules/gallery/app/views/panel/gallery/front_end/albums/index.html.erb b/vendor/built_in_modules/gallery/app/views/panel/gallery/front_end/albums/index.html.erb index 7f7ce0ef8..c56a4a8ae 100644 --- a/vendor/built_in_modules/gallery/app/views/panel/gallery/front_end/albums/index.html.erb +++ b/vendor/built_in_modules/gallery/app/views/panel/gallery/front_end/albums/index.html.erb @@ -20,7 +20,7 @@ <% content_for :page_specific_javascript do %> <%= javascript_include_tag "galleryAPI_frontend" %> - <%= javascript_include_tag "jquery.tinyscrollbar" %> + <%#= javascript_include_tag "jquery.tinyscrollbar" %> <%= javascript_include_tag "rss" %> <% end %> diff --git a/vendor/built_in_modules/gallery/app/views/panel/gallery/front_end/albums/show.html.erb b/vendor/built_in_modules/gallery/app/views/panel/gallery/front_end/albums/show.html.erb index 10520358f..a06c1ad72 100644 --- a/vendor/built_in_modules/gallery/app/views/panel/gallery/front_end/albums/show.html.erb +++ b/vendor/built_in_modules/gallery/app/views/panel/gallery/front_end/albums/show.html.erb @@ -27,7 +27,7 @@ <% content_for :page_specific_javascript do %> <%= javascript_include_tag "galleryAPI_frontend" %> - <%= javascript_include_tag "jquery.tinyscrollbar" %> + <%#= javascript_include_tag "jquery.tinyscrollbar" %> <%= javascript_include_tag "rss" %> <% end %>