Apply suggestions from code review
Co-authored-by: Hypolite Petovan <hypolite@mrpetovan.com>
This commit is contained in:
parent
e60dfef0d0
commit
3607aa32ca
5 changed files with 9 additions and 10 deletions
|
|
@ -60,11 +60,11 @@ const FileBrowser = {
|
|||
init: function (nickname, type) {
|
||||
FileBrowser.nickname = nickname;
|
||||
FileBrowser.type = type;
|
||||
FileBrowser.event = "fbrowser." + type;
|
||||
if (location['hash'] !== "") {
|
||||
FileBrowser.event = 'fbrowser.' + type;
|
||||
if (location['hash'] !== '') {
|
||||
const h = location['hash'].replace('#', '');
|
||||
FileBrowser.event = FileBrowser.event + "." + h.split("-")[0];
|
||||
FileBrowser.id = h.split("-")[1];
|
||||
FileBrowser.event = FileBrowser.event + '.' + h.split('-')[0];
|
||||
FileBrowser.id = h.split('-')[1];
|
||||
}
|
||||
|
||||
console.log('FileBrowser:', nickname, type, FileBrowser.event, FileBrowser.id);
|
||||
|
|
|
|||
|
|
@ -166,7 +166,7 @@ $(function() {
|
|||
|
||||
/* event from comment textarea button popups */
|
||||
/* insert returned bbcode at cursor position or replace selected text */
|
||||
$("body").on("fbrowser.photos.comment", function(e, filename, bbcode, id) {
|
||||
$('body').on('fbrowser.photos.comment', function(e, filename, bbcode, id) {
|
||||
$.colorbox.close();
|
||||
var textarea = document.getElementById("comment-edit-text-" +id);
|
||||
var start = textarea.selectionStart;
|
||||
|
|
@ -1069,7 +1069,7 @@ var Dialog = {
|
|||
* to the event handler
|
||||
*/
|
||||
doImageBrowser : function (name, id) {
|
||||
var url = Dialog._get_url("photos",name,id);
|
||||
var url = Dialog._get_url('photos', name, id);
|
||||
return Dialog.show(url);
|
||||
},
|
||||
|
||||
|
|
@ -1086,7 +1086,7 @@ var Dialog = {
|
|||
* to the event handler
|
||||
*/
|
||||
doFileBrowser : function (name, id) {
|
||||
var url = Dialog._get_url("attachment",name,id);
|
||||
var url = Dialog._get_url('attachment', name, id);
|
||||
return Dialog.show(url);
|
||||
},
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue