This commit is contained in:
BoHung Chiu 2020-10-16 14:44:08 +08:00
parent 95b077b1e4
commit 8f6bee5a8b
3 changed files with 22 additions and 4 deletions

View File

@ -324,7 +324,7 @@ class Admin::GalleriesController < OrbitAdminController
@color_save = 'transparent' @color_save = 'transparent'
end end
if request.xhr? if request.xhr?
render :partial => "album", :collection => @albums render :partial => "albums"
end end
end end

View File

@ -0,0 +1,14 @@
<%= render :partial => "album", :collection => @albums %>
<script type="text/javascript">
$(document).ready(function(){
if( params()['keywords']){
$('#edit-order-btn').css("display",'none');
}else{
$('#edit-order-btn').css("display",'');
}
max_page = <%= (@fiter_albums.length/@limit_count).ceil rescue 1 %>
if( max_page > 1 && max_page >= page_no){
$("#edit-order-btn").hide();
}
})
</script>

View File

@ -10,6 +10,9 @@
var page_no = 2 var page_no = 2
var catch_flag = true var catch_flag = true
var max_page = <%= (@fiter_albums.length/@limit_count).ceil rescue 1 %> var max_page = <%= (@fiter_albums.length/@limit_count).ceil rescue 1 %>
if( max_page > 1){
$("#edit-order-btn").hide();
}
$('.bottomnav').ready(function(){ $('.bottomnav').ready(function(){
function load_html_func(){ function load_html_func(){
$('#load_html').text("<%= t('gallery.wait_time') %>") $('#load_html').text("<%= t('gallery.wait_time') %>")
@ -27,7 +30,8 @@
page_no++ page_no++
catch_flag = true catch_flag = true
if (max_page < page_no){ if (max_page < page_no){
$('#load_html').hide() $("#edit-order-btn").show();
$('#load_html').hide();
} }
$('#load_html').text("<%= t('gallery.load_html') %>") $('#load_html').text("<%= t('gallery.load_html') %>")
}, },
@ -61,7 +65,7 @@
<div class="rgbody" style='float: left;'> <div class="rgbody" style='float: left;'>
<ul id="orbit_gallery" class="gallery clearfix" data-gallery-id="gallery" <ul id="orbit_gallery" class="gallery clearfix" data-gallery-id="gallery"
style='display: inline-flex;flex-wrap: wrap;'> style='display: inline-flex;flex-wrap: wrap;'>
<%= render :partial => "album", :collection => @albums %> <%= render :partial => "albums"%>
</ul> </ul>
</div> </div>
<div class="bottomnav clearfix"> <div class="bottomnav clearfix">
@ -75,5 +79,5 @@
</div> </div>
</div> </div>
<% else %> <% else %>
<%= render :partial => "album", :collection => @albums %> <%= render :partial => "albums" %>
<% end %> <% end %>