fixed all button for page settings and also filter display after page refresh

This commit is contained in:
harrybomrah authored and saurabhbhatia committed 2013-11-06 22:36:59 +08:00
1 parent 591a3e0bc4
commit 49217d4705
4 files changed
+74 -24

No files matched your search

+34 -1
View File
@@ -541,6 +541,8 @@ function changeStatusHidden() {
// Document Ready
$(function() {
showFiltersOnPageRefresh();
new ini();
$('#main-wrap').on('click', '.delete', function() {
api.modal($(this).attr('rel'));
@@ -589,4 +591,35 @@ $(function() {
}
formTip()
sidebarNav();
});
});
var showFiltersOnPageRefresh = function(){
var params = getUrlVars(),
paramfilter = params['new_filter[type]'];
// switch (paramfilter){
// case "role":
// paramfilter = "status";
// break;
// }
if( paramfilter ){
$( "#filter" ).addClass('open');
$( '#filter a[href="#collapse-' + paramfilter + '"]').parent().parent().addClass('active');
$( '#filter #collapse-' + paramfilter ).addClass('in');
}
}
var getUrlVars = function(){
var vars = [], hash;
var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
for(var i = 0; i < hashes.length; i++){
hash = hashes[i].split('=');
vars.push(decodeURIComponent(hash[0]));
vars[decodeURIComponent(hash[0])] = decodeURIComponent(hash[1]);
}
if(vars[0] == window.location.href){
vars =[];
}
return vars;
}