Skip to content

Commit

Permalink
view: Toggle action for same list click behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
doortts committed Apr 3, 2017
1 parent c794532 commit 854a5e4
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions public/javascripts/service/yona.twoColumnMode.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
* Copyright Yona & Yobi Authors & NAVER Corp.
* https://yona.io
**/
var lastClicked = "";

function _initTwoColumnMode(){
var $twoColumnMode = $("#two-column-mode");
var useTwoColumnMode = localStorage.getItem('useTwoColumnMode');
Expand All @@ -21,7 +23,6 @@ function _initTwoColumnMode(){
}

$twoColumnMode.on('click', function () {
console.log('this.checked', this.checked);
if(this.checked){
localStorage.setItem('useTwoColumnMode', true);
attachPageSlideEvent($twoColumnMode, $title);
Expand All @@ -47,7 +48,16 @@ function _initTwoColumnMode(){
}

function bindFrameLoading() {
$title.on('click.iframeLoading', function () {
$title.on('click.iframeLoading', function (e) {
if(lastClicked === this){
if($('#pageslide').is(":visible")){
$(".left-menu").hide(200);
}
return;
} else {
lastClicked = this;
}

$(".left-menu").hide(200);
setTimeout(function () {
$('#pageslide > iframe').ready(function () {
Expand Down

0 comments on commit 854a5e4

Please sign in to comment.