Fix js for ie in list

This commit is contained in:
Christophe Vilayphiou 2012-08-16 01:09:45 +08:00
parent 53c5f6a3b9
commit 96fd89cca3
5 changed files with 23 additions and 21 deletions

View File

@ -129,7 +129,6 @@
var that = this var that = this
this.isShown = false this.isShown = false
//alert(this.isShown+":"+this.$element.attr('class'))
$('body').removeClass('modal-open') $('body').removeClass('modal-open')
@ -1250,8 +1249,8 @@
var that = this var that = this
, complete = function () { , complete = function () {
if (startEvent == 'show') that.reset() if (startEvent == 'show') that.reset()
that.$element.trigger(completeEvent) that.$element.trigger(completeEvent)
mainTablePosition(); setTimeout(mainTablePosition,150);
} }
this.$element this.$element

View File

@ -1,16 +0,0 @@
$(document).on('click', '.list-remove', function(){
var a = [];
$('.checkbox_in_list').each(function(){
if (this.checked) a.push("ids[]=" + this.value);
});
var url = $(this).attr('rel');
if (url.indexOf('?') > -1){
$.getScript(url + '&' + a.join('&'));
}else{
$.getScript(url + '?' + a.join('&'));
}
});
$(document).on('click', '#check_all', function(){
$('.checkbox_in_list').attr("checked", this.checked);
});

View File

@ -0,0 +1,19 @@
<%#= encoding: utf-8 %>
$(document).on('click', '.list-remove', function(){
if(confirm("<%= I18n.t('sure?') %>")){
var a = [];
$('.checkbox_in_list').each(function(){
if (this.checked) a.push("ids[]=" + this.value);
});
var url = $(this).attr('rel');
if (url.indexOf('?') > -1){
$.getScript(url + '&' + a.join('&'));
}else{
$.getScript(url + '?' + a.join('&'));
}
}
});
$(document).on('click', '#check_all', function(){
$('.checkbox_in_list').attr("checked", this.checked);
});

View File

@ -8,5 +8,5 @@
</table> </table>
<div class="form-actions form-fixed pagination-right"> <div class="form-actions form-fixed pagination-right">
<%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('admin.add'), new_admin_design_path, :class => 'btn btn-primary' %> <%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('admin.add'), new_admin_design_path, :class => 'btn btn-primary pull-right' %>
</div> </div>

View File

@ -4,7 +4,7 @@
</table> </table>
<div class="form-actions form-fixed pagination-right"> <div class="form-actions form-fixed pagination-right">
<%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('admin.add'), new_panel_news_back_end_news_bulletin_path, :class => 'btn btn-primary' %> <%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('admin.add'), new_panel_news_back_end_news_bulletin_path, :class => 'btn btn-primary pull-right' %>
<div id="news_bulletin_pagination" class="paginationFixed"> <div id="news_bulletin_pagination" class="paginationFixed">
<%= paginate @news_bulletins, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil, :sort_options => params[:sort_options]} %> <%= paginate @news_bulletins, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil, :sort_options => params[:sort_options]} %>
</div> </div>