backend theater for ie fixed

This commit is contained in:
Harry Bomrah 2013-07-19 18:11:21 +08:00 committed by chris
parent 8c3fb43bf5
commit 1357124f6f
2 changed files with 26 additions and 13 deletions

View File

@ -11,6 +11,19 @@ var galleryAPI = function(){
this.loadArea = null; this.loadArea = null;
this.tagList = $("ul#gallery_tag_list"); this.tagList = $("ul#gallery_tag_list");
this.initialize = function(callbackFn){ this.initialize = function(callbackFn){
if(g.loadArea == "theater"){
if(rcom.getInternetExplorerVersion()!=-1){
var photo_id = window.location.hash.replace("#","");
if(photo_id){
var url = window.location.href;
var params = url.split("/");
// params[params.length-1] = photo_id;
url = url.replace(params[params.length-1],photo_id);
window.location.href = url;
}
}
}
$(document).ready(function(){ $(document).ready(function(){
bindHandlers(); bindHandlers();
}) })
@ -437,19 +450,19 @@ var galleryAPI = function(){
bindHandlers(); bindHandlers();
}) })
} }
if(rcom.getInternetExplorerVersion()!=-1){ // if(rcom.getInternetExplorerVersion()!=-1){
var url_constructor = window.location.href.split("/"); // var url_constructor = window.location.href.split("/");
var url = ""; // var url = "";
for(x=0;x<=url_constructor.length-1;x++){ // for(x=0;x<=url_constructor.length-1;x++){
if(x == url_constructor.length-1){ // if(x == url_constructor.length-1){
url+="#!/"+url_constructor[x]; // url+="#!/"+url_constructor[x];
}else{ // }else{
url+=url_constructor[x]+"/"; // url+=url_constructor[x]+"/";
} // }
} // }
window.location.href = url; // window.location.href = url;
} // }
var albumid = $("#main_pic").attr("data-content"); var albumid = $("#main_pic").attr("data-content");
g.albumArea.find(".bt-back").attr("href","../albums/"+albumid); g.albumArea.find(".bt-back").attr("href","../albums/"+albumid);

View File

@ -106,8 +106,8 @@
<script type="text/javascript"> <script type="text/javascript">
galleryAPI.prototype.locale = "<%= I18n.locale %>"; galleryAPI.prototype.locale = "<%= I18n.locale %>";
var gallery = new galleryAPI(); var gallery = new galleryAPI();
gallery.loadArea = "theater";
gallery.initialize(); gallery.initialize();
gallery.loadArea = "theater";
gallery.loadTheater("<%= params[:id] %>"); gallery.loadTheater("<%= params[:id] %>");
</script> </script>