Admin GNB toggle

git-svn-id: http://xe-core.googlecode.com/svn/branches/maserati@12065 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
flyskyko 2012-11-03 08:50:01 +00:00
parent 14024da697
commit 30e17913ac
3 changed files with 11 additions and 14 deletions

View file

@ -20,9 +20,9 @@
</div>
</header>
<!-- BODY -->
<div class="body wide">
<div class="body <!--@if($_COOKIE['__xe_admin_gnb_status'] == 'close')-->wide<!--@end-->">
<!-- GNB -->
<nav class="gnb" id="gnb">
<nav class="gnb <!--@if($_COOKIE['__xe_admin_gnb_status'] == 'open')-->open<!--@end-->" id="gnb">
<a href="#gnbNav"><i class="x_icon-align-justify x_icon-white"></i><b></b> 메뉴열기/닫기</a>
<ul id="gnbNav">
<!--@foreach($gnbUrlList AS $key=>$value)-->

View file

@ -150,9 +150,6 @@ jQuery(function($){
return false;
});
if(getCookie('__xe_admin_gnb_status') == 'open'){
$xGnb.find('>a[href="#gnbNav"]').trigger('click');
}
// GNB Close
$xGnb

View file

@ -4,15 +4,15 @@ jQuery(function(a){function f(){var b=a(".x>.xin>.body"),d=b.find(">.gnb"),e=b.c
d.attr("tabindex","0").not(":disabled").focus():d.is(":visible")&&d.find("a,input,button,textarea,select").length?d.find("a,input,button,textarea,select").not(":disabled").eq(0).focus():b.focus();return!1});a(document.body).on("click",".x [data-show]",function(){a(a(this).attr("data-show")).show().attr("tabindex","0").focus();return!1});a(document.body).on("click",".x [data-hide]",function(){var b=a(this);a(b.attr("data-hide")).hide();b.focus();return!1});a.fn.xeTabbable=function(){a(this).each(function(){var b=
a(this);b.find(">.x_nav-tabs>li>a").each(function(b){a(this).attr("data-index",b+1)});b.find(">.x_tab-content>.x_tab-pane").each(function(b){a(this).attr("data-index",b+1)})});a('.x .x_tab-content>.x_tab-pane:not(".x_active")').hide()};a(".x .x_tabbable").xeTabbable();a(document.body).on("click",'.x .x_nav-tabs>li>a[href*="#"]',function(){var b=a(this);if(b.parent("li").hasClass("x_disabled"))return!1;b.parent("li").addClass("x_active").siblings().removeClass("x_active");b.closest(".x_nav-tabs").next(".x_tab-content").find(">.x_tab-pane").eq(b.attr("data-index")-
1).addClass("x_active").show().siblings().removeClass("x_active").hide();a(this).parents(".x_tabbable").trigger("tab_change",[parseInt(a(this).attr("data-index"))-1,a(this)]);return!1});a.fn.gnb=function(){var b=a(".x>.xin>.body"),d=b.find(">.gnb"),e=d.find(">ul>li");e.find(">a").prepend("<i />");e.each(function(b){a(this).attr("data-index",b+1)});var g=e.find(">ul>li.active_").closest("li.active").attr("data-index");e.find(">ul>li.active_").clone().addClass("active").attr("data-index",g).prependTo("#gnbNav").find(">a").prepend("<i />");
e.find("ul").prev("a").bind("click focus",function(){a(this).parent("li").addClass("open").siblings("li").removeClass("open");b.removeClass("wide");f();return!1});d.find('>a[href="#gnbNav"]').click(function(){a(this).parent(".gnb").toggleClass("open");b.toggleClass("wide");f();var d=new Date;d.setTime(d.getTime()+30758400);a(this).parent(".gnb").hasClass("open")?setCookie("__xe_admin_gnb_status","open",d):setCookie("__xe_admin_gnb_status","close",d);return!1});"open"==getCookie("__xe_admin_gnb_status")&&
d.find('>a[href="#gnbNav"]').trigger("click");d.prepend('<button type="button" class="close before" />').append('<button type="button" class="close after" />');d.find(">.close").focus(function(){b.addClass("wide");f()});d.find(".exMenu>button").click(function(){a("#gnbNav").toggleClass("ex")})};a(".gnb").gnb();a(".x #lang").mouseleave(function(){a(this).hide()}).focusout(function(){var b=a(this);setTimeout(function(){b.find("a:focus").length||b.mouseleave()},500)});a('.x th>input[type="checkbox"]').change(function(){var b=
a(this),d=b.data("name");b.closest("table").find("input:checkbox").filter(function(){var b=a(this);return!b.prop("disabled")&&(b.attr("name")==d||b.data("name")==d)}).prop("checked",b.prop("checked")).end().end().trigger("update.checkbox",[d,this.checked])});a(document.body).on("click",".x .x_pagination .x_disabled, .x .x_pagination .x_active",function(){return!1});if(1<a(".section").length){var e=a(".x .section").find(">h1:first");e.append('<button type="button" class="snToggle x_icon-chevron-up">Toggle this section</button>');
a(".x .section.collapse>h1>.snToggle").removeClass("x_icon-chevron-up").addClass("x_icon-chevron-down");e.find(">.snToggle").click(function(){var b=a(this),d=b.closest(".section");d.hasClass("collapse")?(d.removeClass("collapse").children("h1:first").siblings().show(),b.removeClass("x_icon-chevron-down").addClass("x_icon-chevron-up")):(d.addClass("collapse").children("h1:first").siblings().hide(),b.removeClass("x_icon-chevron-up").addClass("x_icon-chevron-down"));f()})}e=a(".x .x_alert");e.prepend('<button type="button" class="x_close">&times;</button>');
e.children(".x_close").click(function(){a(this).parent(".x_alert").hide()});a(".x .x_btn").click(function(){if(a(this).hasClass("x_disabled"))return!1});a.fn.vr=function(){this.each(function(){var b=a(this);"|"==b.text()&&b.addClass("vr").filter(":first-child, :last-child").remove()})};a(".x i").vr();a.fn.labelMaker=function(){this.each(function(b){var b=b+1,d=a(this),b="i"+b;d.next("input, textarea, select").filter("[id]").not(":radio, :checkbox").length?d.attr("for",d.next().attr("id")):d.next("input, textarea, select").not("[id]").not(":radio, :checkbox").length?
d.attr("for",b).next().attr("id",b):d.prev(":radio, :checkbox").filter("[id]").length?d.attr("for",d.prev().attr("id")):d.prev(":radio, :checkbox").not("[id]").length?d.attr("for",b).prev().attr("id",b):d.children("input, textarea, select").filter("[id]").length?d.attr("for",d.children("input, textarea, select").filter("[id]").eq(0).attr("id")):d.children("input, textarea, select").not("[id]").length&&d.attr("for",b).children("input, textarea, select").not("[id]").eq(0).attr("id",b)})};a("label:not([for])").labelMaker();
a.fn.checkToggle=function(){function b(){setTimeout(function(){a(":checked").parent("label").addClass("checked");a(':not(":checked")').parent("label").removeClass("checked")},0)}this.change(b);b()};a(":radio, :checkbox").checkToggle();a.fn.fileTypeOverlap=function(){this.each(function(){var b=a(this);b.wrap('<span class="fileBtn" />').before('<button type="button">');var d=b.prev("button");d.text(b.attr("title")).addClass(b.attr("class")).removeClass("overlap");b.attr("class","overlap").width(d.width()).height(d.height()).offset(d.offset())})};
a('input[type="file"].overlap').fileTypeOverlap();a.fn.xeMask=function(){this.each(function(){var b=a(this),d=b.text();/^([\w\-\.]+?)@(([\w-]+\.)+[a-z]{2,})$/ig.test(d)&&b.html(d.replace(/(@.+)$/,'<span class="ellipsis">...</span><span class="cover">$1</span>')).find(">.ellipsis").css({position:"absolute",zIndex:1}).hover(function(){a(this).next(".cover").mouseover()},function(){a(this).next(".cover").mouseout()}).end().find(">.cover").css({zIndex:2,opacity:0}).hover(function(){a(this).css("opacity",
1).prev("span").css("visibility","hidden")},function(){a(this).css("opacity",0).prev("span").css("visibility","visible")}).end()})};a(".masked").xeMask();a.fn.tableSpan=function(){this.each(function(){var b=a(this),d=b.find(">thead>tr:eq(0)>th").length,b=b.find(">tbody>tr:eq(0)>td:only-child");d!=b.attr("colspan")&&b.attr("colspan",d).css("text-align","center")})};a("table").tableSpan()});
e.find("ul").prev("a").bind("click focus",function(){a(this).parent("li").addClass("open").siblings("li").removeClass("open");b.removeClass("wide");f();return!1});d.find('>a[href="#gnbNav"]').click(function(){a(this).parent(".gnb").toggleClass("open");b.toggleClass("wide");f();var d=new Date;d.setTime(d.getTime()+30758400);a(this).parent(".gnb").hasClass("open")?setCookie("__xe_admin_gnb_status","open",d):setCookie("__xe_admin_gnb_status","close",d);return!1});d.prepend('<button type="button" class="close before" />').append('<button type="button" class="close after" />');
d.find(">.close").focus(function(){b.addClass("wide");f()});d.find(".exMenu>button").click(function(){a("#gnbNav").toggleClass("ex")})};a(".gnb").gnb();a(".x #lang").mouseleave(function(){a(this).hide()}).focusout(function(){var b=a(this);setTimeout(function(){b.find("a:focus").length||b.mouseleave()},500)});a('.x th>input[type="checkbox"]').change(function(){var b=a(this),d=b.data("name");b.closest("table").find("input:checkbox").filter(function(){var b=a(this);return!b.prop("disabled")&&(b.attr("name")==
d||b.data("name")==d)}).prop("checked",b.prop("checked")).end().end().trigger("update.checkbox",[d,this.checked])});a(document.body).on("click",".x .x_pagination .x_disabled, .x .x_pagination .x_active",function(){return!1});if(1<a(".section").length){var e=a(".x .section").find(">h1:first");e.append('<button type="button" class="snToggle x_icon-chevron-up">Toggle this section</button>');a(".x .section.collapse>h1>.snToggle").removeClass("x_icon-chevron-up").addClass("x_icon-chevron-down");e.find(">.snToggle").click(function(){var b=
a(this),d=b.closest(".section");d.hasClass("collapse")?(d.removeClass("collapse").children("h1:first").siblings().show(),b.removeClass("x_icon-chevron-down").addClass("x_icon-chevron-up")):(d.addClass("collapse").children("h1:first").siblings().hide(),b.removeClass("x_icon-chevron-up").addClass("x_icon-chevron-down"));f()})}e=a(".x .x_alert");e.prepend('<button type="button" class="x_close">&times;</button>');e.children(".x_close").click(function(){a(this).parent(".x_alert").hide()});a(".x .x_btn").click(function(){if(a(this).hasClass("x_disabled"))return!1});
a.fn.vr=function(){this.each(function(){var b=a(this);"|"==b.text()&&b.addClass("vr").filter(":first-child, :last-child").remove()})};a(".x i").vr();a.fn.labelMaker=function(){this.each(function(b){var b=b+1,d=a(this),b="i"+b;d.next("input, textarea, select").filter("[id]").not(":radio, :checkbox").length?d.attr("for",d.next().attr("id")):d.next("input, textarea, select").not("[id]").not(":radio, :checkbox").length?d.attr("for",b).next().attr("id",b):d.prev(":radio, :checkbox").filter("[id]").length?
d.attr("for",d.prev().attr("id")):d.prev(":radio, :checkbox").not("[id]").length?d.attr("for",b).prev().attr("id",b):d.children("input, textarea, select").filter("[id]").length?d.attr("for",d.children("input, textarea, select").filter("[id]").eq(0).attr("id")):d.children("input, textarea, select").not("[id]").length&&d.attr("for",b).children("input, textarea, select").not("[id]").eq(0).attr("id",b)})};a("label:not([for])").labelMaker();a.fn.checkToggle=function(){function b(){setTimeout(function(){a(":checked").parent("label").addClass("checked");
a(':not(":checked")').parent("label").removeClass("checked")},0)}this.change(b);b()};a(":radio, :checkbox").checkToggle();a.fn.fileTypeOverlap=function(){this.each(function(){var b=a(this);b.wrap('<span class="fileBtn" />').before('<button type="button">');var d=b.prev("button");d.text(b.attr("title")).addClass(b.attr("class")).removeClass("overlap");b.attr("class","overlap").width(d.width()).height(d.height()).offset(d.offset())})};a('input[type="file"].overlap').fileTypeOverlap();a.fn.xeMask=function(){this.each(function(){var b=
a(this),d=b.text();/^([\w\-\.]+?)@(([\w-]+\.)+[a-z]{2,})$/ig.test(d)&&b.html(d.replace(/(@.+)$/,'<span class="ellipsis">...</span><span class="cover">$1</span>')).find(">.ellipsis").css({position:"absolute",zIndex:1}).hover(function(){a(this).next(".cover").mouseover()},function(){a(this).next(".cover").mouseout()}).end().find(">.cover").css({zIndex:2,opacity:0}).hover(function(){a(this).css("opacity",1).prev("span").css("visibility","hidden")},function(){a(this).css("opacity",0).prev("span").css("visibility",
"visible")}).end()})};a(".masked").xeMask();a.fn.tableSpan=function(){this.each(function(){var b=a(this),d=b.find(">thead>tr:eq(0)>th").length,b=b.find(">tbody>tr:eq(0)>td:only-child");d!=b.attr("colspan")&&b.attr("colspan",d).css("text-align","center")})};a("table").tableSpan()});
jQuery(function(a){a.fn.xeModalWindow=function(){this.not(".xe-modal-window").addClass("xe-modal-window").each(function(){a(a(this).attr("href")).addClass("x").hide()}).click(function(){var f=a(this);"showing"==a(f.attr("href")).data("state")?f.trigger("close.mw"):f.trigger("open.mw");return!1}).bind("open.mw",function(){var f=a(this),e,b;e=a(f.attr("href"));e.parent("body").length||(b=a('<button type="button" class="x_close">&times;</button>'),b.click(function(){e.data("anchor").trigger("close.mw")}),
e.find("[data-hide]").click(function(){e.data("anchor").trigger("close.mw")}),a("body").append('<div class="x_modal-backdrop"></div>').append(e),e.prepend(b));e.data("anchor",f);b=a.Event("before-open.mw");f.trigger(b);if(b.isDefaultPrevented())return!1;e=a(f.attr("href"));b=f.data("duration")||"fast";e.data("state","showing");a(document).bind("keydown.mw",function(a){if(27==a.which)return f.trigger("close.mw"),!1});e.fadeIn(b,function(){f.trigger("after-open.mw")}).find("button.x_close:first").focus().end().prev(".x_modal-backdrop").show();
a("body").css("overflow","hidden")}).bind("close.mw",function(){var f=a(this),e,b;e=a.Event("before-close.mw");f.trigger(e);if(e.isDefaultPrevented())return!1;e=a(f.attr("href"));b=f.data("duration")||"fast";e.data("state","hiding");e.fadeOut(b,function(){f.trigger("after-close.mw")}).prev(".x_modal-backdrop").hide();a("body").css("overflow","auto");f.focus()});a("div.x_modal").addClass("x").hide()};a("a.modalAnchor").xeModalWindow()});