2222 <div class =" col-md-2 col-lg-2 col-sm-2 col-xs-2 left-nav fill" id =" lfm-leftcol" >
2323 <div id =" tree1" >
2424 </div >
25- <a href =" #!" id =" add-folder" class =" add-folder btn btn-default btn-xs" ><i class =" fa fa-plus" ></i > {{ Lang:: get (' laravel-filemanager::lfm.menu-new' ) } } </a >
2625 </div >
2726 <div class =" col-md-10 col-lg-10 col-sm-10 col-xs-10 right-nav" id =" right-nav" >
2827 <nav class =" navbar navbar-default" >
@@ -328,7 +327,7 @@ function notImp() {
328327 bootbox .alert (' Not yet implemented!' );;
329328 }
330329
331- $ (" #add-folder " ).click ( function () {
330+ $ (" body " ).on ( ' click ' , ' #add-folder ' , function () {
332331 bootbox .prompt (" {{ Lang:: get (' laravel-filemanager::lfm.message-name' ) } }" , function (result ) {
333332 if (result === null ) {
334333 } else {
@@ -364,21 +363,20 @@ function getUrlParam(paramName) {
364363 }
365364
366365 var funcNum = getUrlParam (' CKEditorFuncNum' );
367- window .opener .CKEDITOR .tools .callFunction (funcNum, path + " / " + file);
366+ window .opener .CKEDITOR .tools .callFunction (funcNum, path + ' / ' + file);
368367
369- @if ((Session:: has (' lfm_type' )) && (Session:: get (' lfm_type' ) == " Images" ) )
370- if (path != ' /' ) {
371- window .opener .CKEDITOR .tools .callFunction (funcNum, ' {{ \Config:: get (' lfm.images_url' ) } }' + path + " /" + file);
372- } else {
373- window .opener .CKEDITOR .tools .callFunction (funcNum, ' {{ \Config:: get (' lfm.images_url' ) } }' + file);
374- }
375- @else
376- if (path != ' /' ) {
377- window .opener .CKEDITOR .tools .callFunction (funcNum, ' {{ \Config:: get (' lfm.files_url' ) } }' + path + " /" + file);
378- } else {
379- window .opener .CKEDITOR .tools .callFunction (funcNum, ' {{ \Config:: get (' lfm.files_url' ) } }' + file);
380- }
368+ var item_url = " {{ Config:: get (' lfm.images_url' ) } }" ;
369+
370+ @if ((Session:: has (' lfm_type' )) && (Session:: get (' lfm_type' ) != " Images" ) )
371+ item_url = " {{ Config:: get (' lfm.files_url' ) } }" ;
381372 @endif
373+
374+ if (path != ' /' ) {
375+ item_url = item_url + path + ' /' ;
376+ }
377+
378+ window .opener .CKEDITOR .tools .callFunction (funcNum, item_url + file);
379+
382380 window .close ();
383381 }
384382
@@ -387,8 +385,7 @@ function rename(x) {
387385 title: " {{ Lang:: get (' laravel-filemanager::lfm.message-rename' ) } }" ,
388386 value: x,
389387 callback : function (result ) {
390- if (result === null ) {
391- } else {
388+ if (result !== null ) {
392389 $ .ajax ({
393390 type: " GET" ,
394391 dataType: " text" ,
0 commit comments