1
0
Fork 0

Merge pull request #1196 from pixelfed/frontend-ui-refactor

Frontend ui refactor
This commit is contained in:
daniel 2019-04-24 22:50:19 -06:00 committed by GitHub
commit 870ba20f7b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 21 additions and 1 deletions

View File

@ -16,6 +16,7 @@ use Auth, Cache;
use Illuminate\Http\Request;
use League\Fractal;
use App\Util\Media\Filter;
use Illuminate\Support\Str;
class StatusController extends Controller
{

View File

@ -19,6 +19,25 @@ $(document).ready(function() {
new Vue({
el: '#content'
});
$('.metro-classic-compose textarea[name="caption"]').on('click', function(e) {
let el = $(this);
el.attr('rows', 4);
});
$('.metro-classic-compose textarea[name="caption"]').on('change keyup paste', function(e) {
let el = $(this);
let len = el.val().length;
let limit = el.attr('data-limit');
let res = len;
if(len > limit) {
res = '<span class="text-danger">' + (limit - len) + '</span>';
} else {
res = '<span>' + len + '</span>';
}
$('.metro-classic-compose .caption-counter').html(res);
})
});
</script>
@endpush

View File

@ -1,4 +1,4 @@
<div class="card card-md-rounded-0">
<div class="card card-md-rounded-0 metro-classic-compose">
<div class="card-header bg-white font-weight-bold d-inline-flex justify-content-between">
<div>{{__('Create New Post')}}</div>
</div>