From 5467ca6b7e259f489927c51ad5ab00ef4835e1c2 Mon Sep 17 00:00:00 2001 From: rr- Date: Tue, 21 Feb 2017 19:09:18 +0100 Subject: [PATCH] client/posts: improve placeholder in file dropper The default one was too long to fit in the sidebar --- client/html/file_dropper.tpl | 2 +- client/js/controls/file_dropper_control.js | 2 ++ client/js/controls/post_edit_sidebar_control.js | 5 ++++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/client/html/file_dropper.tpl b/client/html/file_dropper.tpl index 3da2f4f8..3123cd01 100644 --- a/client/html/file_dropper.tpl +++ b/client/html/file_dropper.tpl @@ -15,7 +15,7 @@ <% if (ctx.allowUrls) { %>
- + <% if (ctx.lock) { %> <% } else { %> diff --git a/client/js/controls/file_dropper_control.js b/client/js/controls/file_dropper_control.js index 407fa9d3..f725ee01 100644 --- a/client/js/controls/file_dropper_control.js +++ b/client/js/controls/file_dropper_control.js @@ -18,6 +18,8 @@ class FileDropperControl extends events.EventTarget { allowUrls: options.allowUrls, lock: options.lock, id: 'file-' + Math.random().toString(36).substring(7), + urlPlaceholder: + options.urlPlaceholder || 'Alternatively, paste an URL here.', }); this._dropperNode = source.querySelector('.file-dropper'); diff --git a/client/js/controls/post_edit_sidebar_control.js b/client/js/controls/post_edit_sidebar_control.js index f1cfe934..3da2fa41 100644 --- a/client/js/controls/post_edit_sidebar_control.js +++ b/client/js/controls/post_edit_sidebar_control.js @@ -72,7 +72,10 @@ class PostEditSidebarControl extends events.EventTarget { if (this._contentInputNode) { this._contentFileDropper = new FileDropperControl( - this._contentInputNode, {allowUrls: true, lock: true}); + this._contentInputNode, { + allowUrls: true, + lock: true, + urlPlaceholder: '...or paste an URL here.'}); this._contentFileDropper.addEventListener('fileadd', e => { this._newPostContent = e.detail.files[0]; });