better handle urls

This commit is contained in:
2018-07-28 16:45:03 +02:00
parent f879d195df
commit 3a8d54a569
7 changed files with 59 additions and 21 deletions
+20 -5
View File
@@ -21,11 +21,26 @@ $(function () {
}, 500)
}, 2500)
$('.block-collapse').on('click', (e) => {
$(e.target).closest('.block-collapse').addClass('reveal')
}).on('dblclick', (e) => {
$(e.target).closest('.block-collapse').removeClass('reveal')
});
// toggle collapse when clicked outside link, without drag
$('.block-collapse')
.on('mousedown', (e) => {
let $bc = $(e.target).closest('.block-collapse')
$bc.data('mx', e.screenX);
$bc.data('my', e.screenY);
})
.on('mouseup', (e) => {
if (e.target.nodeName === 'A') return
let $bc = $(e.target).closest('.block-collapse')
if (typeof $bc.data('mx') !== 'undefined') {
let x0 = +$bc.data('mx');
let y0 = +$bc.data('my');
if (Math.abs(x0 - e.screenX) > 5 || Math.abs(y0 - e.screenY) > 5) {
// drag
} else {
$(e.target).closest('.block-collapse').toggleClass('reveal')
}
}
})
})
// auto-alias
+4
View File
@@ -46,3 +46,7 @@
.small2 {
font-size: 70%;
}
a.link-no-color {
color: unset;
}
-4
View File
@@ -15,7 +15,3 @@ html {
@import "bootstrap-customizations/navbar";
@import "bootstrap-customizations/footer";
@import "bootstrap-customizations/help";
a.link-no-color {
color: unset;
}
+2 -2
View File
@@ -40,7 +40,7 @@
@if($user->website)
<tr>
<td class="text-center pr-2">@icon(fa-link, User's Website:)</td>
<td><a href="{{ $user->website }}">{{ $user->website }}</a></td>
<td>{!! Widget::tryLink($user->website) !!}</td>
</tr>
@endif
@@ -60,7 +60,7 @@
</div>
{{-- Table list card --}}
<div class="col-md-8">
<div class="col-md-8 mt-2 mt-md-0">
<div class="card">
<div class="card-header card-header-extra">
<h2>
+5 -8
View File
@@ -22,16 +22,14 @@
<div class="row mx-auto col-md-12 justify-content-center mb-1 border rounded px-0 py-2 box-shadow mb-3">
<div class="col-md-6">
@if($table->description)
<p class="last-p-mb-0">
<b>Description</b><br>
{!! Widget::collapsible($table->description, 400, '8em') !!}
</p>
<b>Description</b>
{!! Widget::collapsible($table->description, 400, '8em') !!}
@endif
@if($table->origin)
<p class="last-p-mb-0">
<b>Source</b><br>
{{ $table->origin }}
{!! Widget::tryLink($table->origin) !!}
</p>
@endif
</div>
@@ -42,9 +40,8 @@
<tr>
<th class="text-right pr-2">Author</th>
<td>
<a href="{{route('profile.view', $table->owner->name)}}">
{{ $table->owner->handle }}
</a>
{{ $table->owner->title }}
(<a href="{{route('profile.view', $table->owner->name)}}">{{ $table->owner->handle }}</a>)
</td>
</tr>