From 89b573a6f3b7409ba9f8ba9fe41ed06b8106836b Mon Sep 17 00:00:00 2001 From: marijus Date: Tue, 25 Mar 2014 15:27:45 +0100 Subject: fix lock permissions view and autoload not kicking in on touch devices under certain conditions --- mod/lockview.php | 12 ++++++------ view/css/conversation.css | 19 ++++--------------- view/js/main.js | 26 ++++---------------------- view/theme/redbasic/css/style.css | 9 --------- view/theme/redbasic/js/redbasic.js | 3 +++ view/tpl/conv_item.tpl | 4 ++-- view/tpl/hdr.tpl | 2 -- view/tpl/head.tpl | 2 +- 8 files changed, 20 insertions(+), 57 deletions(-) diff --git a/mod/lockview.php b/mod/lockview.php index 32e7a3afb..785f491aa 100644 --- a/mod/lockview.php +++ b/mod/lockview.php @@ -40,7 +40,7 @@ function lockview_content(&$a) { $deny_users = expand_acl($item['deny_cid']); $deny_groups = expand_acl($item['deny_gid']); - $o = t('Visible to:') . '
'; + $o = '
  • ' . t('Visible to:') . '
  • '; $l = array(); stringify_array_elms($allowed_groups,true); @@ -52,28 +52,28 @@ function lockview_content(&$a) { $r = q("SELECT name FROM `groups` WHERE hash IN ( " . implode(', ', $allowed_groups) . " )"); if($r) foreach($r as $rr) - $l[] = '' . $rr['name'] . ''; + $l[] = '
  • ' . $rr['name'] . '
  • '; } if(count($allowed_users)) { $r = q("SELECT xchan_name FROM xchan WHERE xchan_hash IN ( " . implode(', ',$allowed_users) . " )"); if($r) foreach($r as $rr) - $l[] = $rr['xchan_name']; + $l[] = '
  • ' . $rr['xchan_name'] . '
  • '; } if(count($deny_groups)) { $r = q("SELECT name FROM `groups` WHERE hash IN ( " . implode(', ', $deny_groups) . " )"); if($r) foreach($r as $rr) - $l[] = '' . $rr['name'] . ''; + $l[] = '
  • ' . $rr['name'] . '
  • '; } if(count($deny_users)) { $r = q("SELECT xchan_name FROM xchan WHERE xchan_hash IN ( " . implode(', ', $deny_users) . " )"); if($r) foreach($r as $rr) - $l[] = '' . $rr['xchan_name'] . ''; + $l[] = '
  • ' . $rr['xchan_name'] . '
  • '; } - echo $o . implode(', ', $l); + echo $o . implode($l); killme(); } diff --git a/view/css/conversation.css b/view/css/conversation.css index 8d7404b5d..46e1ed436 100644 --- a/view/css/conversation.css +++ b/view/css/conversation.css @@ -204,25 +204,14 @@ } -/* -.wall-item-lock { - position: absolute; - left: 105px; - top: 1px; -} - -.comment .wall-item-lock { - left: 65px; -} - -.wall-item-lock { - -} -*/ .lockview { cursor: pointer; } +.lockview-panel { + padding: 3px 20px; +} + .wall-item-location { text-overflow: ellipsis; max-width: 30%; diff --git a/view/js/main.js b/view/js/main.js index 5f88ea9ca..38cde749c 100644 --- a/view/js/main.js +++ b/view/js/main.js @@ -728,27 +728,10 @@ function updateConvItems(mode,data) { return cursor; } - var lockvisible = false; - function lockview(event,id) { - event = event || window.event; - cursor = getPosition(event); - if(lockvisible) { - lockviewhide(); - } - else { - lockvisible = true; - $.get('lockview/' + id, function(data) { - $('#panel').html(data); - $('#panel').css({ 'left': cursor.x + 5 , 'top': cursor.y + 5}); - $('#panel').show(); - }); - } - } - - function lockviewhide() { - lockvisible = false; - $('#panel').hide(); + $.get('lockview/' + id, function(data) { + $('#panel-' + id).html(data); + }); } function post_comment(id) { @@ -1022,7 +1005,7 @@ $(window).scroll(function () { $('#more').show(); } - if($(window).scrollTop() + $(window).height() == $(document).height()) { + if($(window).scrollTop() + $(window).height() > $(document).height() - 100) { if((pageHasMoreContent) && (! loadingPage)) { $('#more').hide(); $('#no-more').hide(); @@ -1032,7 +1015,6 @@ $(window).scroll(function () { loadingPage = true; liveUpdate(); } - } } }); diff --git a/view/theme/redbasic/css/style.css b/view/theme/redbasic/css/style.css index 6a4f836b1..edc8eebbb 100644 --- a/view/theme/redbasic/css/style.css +++ b/view/theme/redbasic/css/style.css @@ -113,15 +113,6 @@ blockquote { padding: 5px; } -#panel { - background-color: ivory; - position: absolute; - z-index: 2; - width: 30%; - padding: 25px; - border: 1px solid #444; -} - .heart { color: #FF0000; font-size: 100%; diff --git a/view/theme/redbasic/js/redbasic.js b/view/theme/redbasic/js/redbasic.js index c58711e94..70869f44b 100644 --- a/view/theme/redbasic/js/redbasic.js +++ b/view/theme/redbasic/js/redbasic.js @@ -30,6 +30,9 @@ if ($('aside').html().length == 0) { } $('#expand-tabs').click(function() { + if(!$('#tabs-collapse-1').hasClass('in')){ + $('html, body').animate({ scrollTop: 0 }, 'slow'); + } $('#expand-tabs-icon').toggleClass('icon-circle-arrow-down').toggleClass('icon-circle-arrow-up'); }); diff --git a/view/tpl/conv_item.tpl b/view/tpl/conv_item.tpl index 8d59951e7..dcf82e765 100755 --- a/view/tpl/conv_item.tpl +++ b/view/tpl/conv_item.tpl @@ -34,8 +34,8 @@
    -
    - {{if $item.lock}} {{/if}}{{$item.name}}{{if $item.owner_url}} {{$item.via}} {{$item.owner_name}}{{/if}}
    +
    diff --git a/view/tpl/hdr.tpl b/view/tpl/hdr.tpl index f1e78b897..efb43224c 100644 --- a/view/tpl/hdr.tpl +++ b/view/tpl/hdr.tpl @@ -3,5 +3,3 @@ - - diff --git a/view/tpl/head.tpl b/view/tpl/head.tpl index c676cd773..e7b41523f 100755 --- a/view/tpl/head.tpl +++ b/view/tpl/head.tpl @@ -1,6 +1,6 @@ - +