Fix hash parsing 3
This commit is contained in:
9
jquery/databap.js
vendored
9
jquery/databap.js
vendored
@@ -99,11 +99,12 @@ function Databap()
|
||||
if(!hash) return decodeURIComponent(window.location.hash.slice(1));
|
||||
else
|
||||
{
|
||||
console.log('encoding: '+hash);
|
||||
window.location.hash = '#'+encodeURIComponent(hash.slice(hash.substr(0, 1)=='#'?1:0));
|
||||
|
||||
//favicon, bug firefox
|
||||
var link = $('link[rel="shortcut icon"]').remove().attr("href");
|
||||
$('<link href="'+ link +'" rel="shortcut icon" type="image/x-icon" />').appendTo('head');
|
||||
//var link = $('link[rel="shortcut icon"]').remove().attr("href");
|
||||
//$('<link href="'+ link +'" rel="shortcut icon" type="image/x-icon" />').appendTo('head');
|
||||
}
|
||||
};
|
||||
|
||||
@@ -518,13 +519,15 @@ function Databap()
|
||||
{
|
||||
bAbsolute = bAbsolute || false;
|
||||
if(sPage.length==1) sPage = self.vars.hash_to_page[sPage]; //if hash is provided instead of page
|
||||
return (bAbsolute?self.vars.serv_name:'')+'#'+sPage+((iItemId>0 || iItemId!='')?'-'+escape($.trim(iItemId)):'');
|
||||
return (bAbsolute?self.vars.serv_name:'')+'#'+sPage+((iItemId>0 || iItemId!='')?'-'+$.trim(iItemId):'');
|
||||
};
|
||||
|
||||
this.goToInternalLink = function(sPage, iItemId, bFade)
|
||||
{
|
||||
self.vars2('fade', bFade || false);
|
||||
|
||||
console.log('goToInternalLink: '+iItemId);
|
||||
|
||||
iItemId = iItemId || 0;
|
||||
var sHash = self.getInternalLink(sPage, iItemId).substr(1);
|
||||
if(sHash==self.hash()) self.onHashChange({force:true});
|
||||
|
||||
Reference in New Issue
Block a user