route validation and prevent navigation from breaking on re-cklick
This commit is contained in:
15
js/main.js
15
js/main.js
@@ -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);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user