route validation and prevent navigation from breaking on re-cklick

This commit is contained in:
Joe
2017-02-07 21:55:04 -06:00
parent b557c002ae
commit cb3e4ca7a0
7 changed files with 68 additions and 27 deletions

View File

@@ -8,8 +8,18 @@ var ibuyproperties=(function(){
function navShow(cls,ele){
$("."+cls).addClass('hide');
$("#pnl_"+ele).removeClass('hide');
$(".topNav"+cls).removeClass('active');
$(".topNav"+ele).addClass('active');
$(".topNav"+cls).removeClass('active disabled');
$(".topNav"+cls).removeAttr('href');
$.each($(".topNav"+cls+">a"),function(pos,ele){
$(ele).attr("href", $(ele).attr("mytargeturl"));
});
$($(".topNav"+ele)[0]).addClass('active disabled');
$($(".topNav"+ele)[0]).addClass('active disabled');
$($(".topNav"+ele+">a")[0]).removeAttr('href');
}
function toggleButton(elEnable,elDisable){
@@ -38,6 +48,7 @@ $(document).ready(function(){
if (ibuyproperties.isDebugMode) {
$("body").append(ibuyproperties.templateHelper.get("debug")({}));
}
ibuyproperties.router.route();
$(window).on('hashchange', ibuyproperties.router.route);
});