Fix menu toggle element element hiding, better mobile support

This commit is contained in:
Dane Everitt 2017-01-19 23:19:26 -05:00
parent da92796ca1
commit 5567269bf3
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
3 changed files with 30 additions and 16 deletions

View file

@ -75,7 +75,7 @@ code {
} }
.hasFileHover * { .hasFileHover * {
pointer-events: none; pointer-events: none !important;
} }
td.has-progress { td.has-progress {
@ -103,3 +103,13 @@ td.has-progress {
.use-pointer { .use-pointer {
cursor: pointer !important; cursor: pointer !important;
} }
.input-loader {
display: none;
position:relative;
top: -23px;
float: right;
right: 5px;
color: #cccccc;
height: 0;
}

View file

@ -83,7 +83,7 @@ class ContextMenuClass {
} }
rightClick() { rightClick() {
$('[data-action="toggleMenu"]').on('mousedown', () => { $('[data-action="toggleMenu"]').on('mousedown', event => {
event.preventDefault(); event.preventDefault();
this.showMenu(event); this.showMenu(event);
}); });
@ -173,8 +173,12 @@ class ContextMenuClass {
}); });
} }
$(window).on('click', () => { $(window).unbind().on('click', event => {
$(menu).remove(); if($(event.target).is('.disable-menu-hide')) {
event.preventDefault();
return;
}
$(menu).unbind().remove();
if(!_.isNull(this.activeLine)) this.activeLine.removeClass('active'); if(!_.isNull(this.activeLine)) this.activeLine.removeClass('active');
}); });
} }

View file

@ -22,8 +22,8 @@
<tr> <tr>
<th style="width:2%;text-align:center;" class="middle"><i class="fa fa-refresh muted muted-hover use-pointer" data-action="reload-files"></i></th> <th style="width:2%;text-align:center;" class="middle"><i class="fa fa-refresh muted muted-hover use-pointer" data-action="reload-files"></i></th>
<th style="width:55%">@lang('server.files.file_name')</th> <th style="width:55%">@lang('server.files.file_name')</th>
<th style="width:15%">@lang('server.files.size')</th> <th style="width:15%" class="hidden-xs">@lang('server.files.size')</th>
<th style="width:20%">@lang('server.files.last_modified')</th> <th style="width:20%" class="hidden-xs">@lang('server.files.last_modified')</th>
<th style="width:8%"> <th style="width:8%">
<label class="btn btn-primary btn-xs btn-file"> <label class="btn btn-primary btn-xs btn-file">
Upload <input type="file" id="files_touch_target" style="display: none;"/> Upload <input type="file" id="files_touch_target" style="display: none;"/>
@ -47,8 +47,8 @@
<tr data-type="disabled"> <tr data-type="disabled">
<td><i class="fa fa-folder" style="margin-left: 0.859px;"></i></td> <td><i class="fa fa-folder" style="margin-left: 0.859px;"></i></td>
<td><a href="/server/{{ $server->uuidShort }}/files" data-action="directory-view">&larr;</a></a></td> <td><a href="/server/{{ $server->uuidShort }}/files" data-action="directory-view">&larr;</a></a></td>
<td></td> <td class="hidden-xs"></td>
<td></td> <td class="hidden-xs"></td>
<td></td> <td></td>
</tr> </tr>
@endif @endif
@ -58,8 +58,8 @@
<td data-name="{{ rawurlencode($directory['link']) }}"> <td data-name="{{ rawurlencode($directory['link']) }}">
<a href="/server/{{ $server->uuidShort }}/files" data-action="directory-view">&larr; {{ $directory['link_show'] }}</a> <a href="/server/{{ $server->uuidShort }}/files" data-action="directory-view">&larr; {{ $directory['link_show'] }}</a>
</td> </td>
<td></td> <td class="hidden-xs"></td>
<td></td> <td class="hidden-xs"></td>
<td></td> <td></td>
</tr> </tr>
@endif @endif
@ -69,8 +69,8 @@
<td data-identifier="name" data-name="{{ rawurlencode($folder['entry']) }}" data-path="@if($folder['directory'] !== ''){{ rawurlencode($folder['directory']) }}@endif/"> <td data-identifier="name" data-name="{{ rawurlencode($folder['entry']) }}" data-path="@if($folder['directory'] !== ''){{ rawurlencode($folder['directory']) }}@endif/">
<a href="/server/{{ $server->uuidShort }}/files" data-action="directory-view">{{ $folder['entry'] }}</a> <a href="/server/{{ $server->uuidShort }}/files" data-action="directory-view">{{ $folder['entry'] }}</a>
</td> </td>
<td data-identifier="size">{{ $folder['size'] }}</td> <td data-identifier="size" class="hidden-xs">{{ $folder['size'] }}</td>
<td data-identifier="modified"> <td data-identifier="modified" class="hidden-xs">
<?php $carbon = Carbon::createFromTimestamp($folder['date'])->timezone(env('APP_TIMEZONE', 'America/New_York')); ?> <?php $carbon = Carbon::createFromTimestamp($folder['date'])->timezone(env('APP_TIMEZONE', 'America/New_York')); ?>
@if($carbon->diffInMinutes(Carbon::now()) > 60) @if($carbon->diffInMinutes(Carbon::now()) > 60)
{{ $carbon->format('m/d/y H:i:s') }} {{ $carbon->format('m/d/y H:i:s') }}
@ -80,7 +80,7 @@
{{ $carbon->diffForHumans() }} {{ $carbon->diffForHumans() }}
@endif @endif
</td> </td>
<td><button class="btn btn-xxs btn-default" data-action="toggleMenu" style="padding:2px 6px 0px;"><i class="fa fa-ellipsis-h"></i></button></td> <td><button class="btn btn-xxs btn-default disable-menu-hide" data-action="toggleMenu" style="padding:2px 6px 0px;"><i class="fa fa-ellipsis-h disable-menu-hide"></i></button></td>
</tr> </tr>
@endforeach @endforeach
@foreach ($files as $file) @foreach ($files as $file)
@ -146,8 +146,8 @@
{{ $file['entry'] }} {{ $file['entry'] }}
@endif @endif
</td> </td>
<td data-identifier="size">{{ $file['size'] }}</td> <td data-identifier="size" class="hidden-xs">{{ $file['size'] }}</td>
<td data-identifier="modified"> <td data-identifier="modified" class="hidden-xs">
<?php $carbon = Carbon::createFromTimestamp($file['date'])->timezone(env('APP_TIMEZONE', 'America/New_York')); ?> <?php $carbon = Carbon::createFromTimestamp($file['date'])->timezone(env('APP_TIMEZONE', 'America/New_York')); ?>
@if($carbon->diffInMinutes(Carbon::now()) > 60) @if($carbon->diffInMinutes(Carbon::now()) > 60)
{{ $carbon->format('m/d/y H:i:s') }} {{ $carbon->format('m/d/y H:i:s') }}
@ -157,7 +157,7 @@
{{ $carbon->diffForHumans() }} {{ $carbon->diffForHumans() }}
@endif @endif
</td> </td>
<td><button class="btn btn-xxs btn-default" data-action="toggleMenu" style="padding:2px 6px 0px;"><i class="fa fa-ellipsis-h"></i></button></td> <td><button class="btn btn-xxs btn-default disable-menu-hide" data-action="toggleMenu" style="padding:2px 6px 0px;"><i class="fa fa-ellipsis-h disable-menu-hide"></i></button></td>
</tr> </tr>
@endforeach @endforeach
</tbody> </tbody>