Skip to content

Commit

Permalink
view: Mark selected list item in two column mode
Browse files Browse the repository at this point in the history
  • Loading branch information
doortts committed Apr 7, 2017
1 parent 261d795 commit a5d9000
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
4 changes: 4 additions & 0 deletions app/assets/stylesheets/less/_page.less
Original file line number Diff line number Diff line change
Expand Up @@ -6836,6 +6836,10 @@ div.diff-body[data-outdated="true"] tr:hover .icon-comment {
margin-left: -120px !important;
}

.highlightBg {
background-color: #eee !important;
}

#pageslide {
/* These styles MUST be included. Do not change. */
display: none;
Expand Down
11 changes: 10 additions & 1 deletion public/javascripts/service/yona.twoColumnMode.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ function _initTwoColumnMode(){

$('#two-column-mode-checkbox').popover({trigger: "hover", placement: "top", delay: { show: 1000, hide: 100 }});

// when to check box click
$('.mass-update-check').on('click', function (e) {
e.stopPropagation();
});

if( useTwoColumnMode === 'true'){
attachPageSlideEvent($twoColumnMode, $title);
bindFrameLoading();
Expand All @@ -30,7 +35,7 @@ function _initTwoColumnMode(){
$('#pageslide').html("<div>Loading...</div>");
} else {
localStorage.setItem('useTwoColumnMode', false);
$('.post-item').css("cursor", "");
$('.post-item').removeClass('highlightBg').css("cursor", "");
unbindEvents();
}
});
Expand All @@ -39,6 +44,7 @@ function _initTwoColumnMode(){

function attachPageSlideEvent(twoColumnMode, title){
twoColumnMode.prop('checked', true);

title.pageslide({direction: "left", speed: 0});
$('.post-item').css("cursor", "pointer");
}
Expand All @@ -50,6 +56,9 @@ function _initTwoColumnMode(){

function bindFrameLoading() {
$title.on('click.iframeLoading', function (e) {
$('.post-item').removeClass('highlightBg');
$(this).closest('.post-item').addClass('highlightBg');

if(lastClicked === this){
if($('#pageslide').is(":visible")){
$(".left-menu").hide(0);
Expand Down

0 comments on commit a5d9000

Please sign in to comment.