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 Illuminate\Http\Request;
use League\Fractal; use League\Fractal;
use App\Util\Media\Filter; use App\Util\Media\Filter;
use Illuminate\Support\Str;
class StatusController extends Controller class StatusController extends Controller
{ {

View file

@ -19,6 +19,25 @@ $(document).ready(function() {
new Vue({ new Vue({
el: '#content' 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> </script>
@endpush @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 class="card-header bg-white font-weight-bold d-inline-flex justify-content-between">
<div>{{__('Create New Post')}}</div> <div>{{__('Create New Post')}}</div>
</div> </div>