Skip to content

Commit 68be0d7

Browse files
committed
Merge branch 'master' of git://github.com/pyaehein/laravel-filemanager into pyaehein-master
2 parents 3641299 + a32d0f3 commit 68be0d7

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

public/js/lfm.js

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,17 @@
88
localStorage.setItem('target_input', $(this).data('input'));
99
localStorage.setItem('target_preview', $(this).data('preview'));
1010
window.open(route_prefix + '?type=' + type, 'FileManager', 'width=900,height=600');
11+
window.SetUrl = function (url, file_path) {
12+
//set the value of the desired input to image url
13+
var target_input = $('#' + localStorage.getItem('target_input'));
14+
target_input.val(file_path).trigger('change');
15+
16+
//set or change the preview image src
17+
var target_preview = $('#' + localStorage.getItem('target_preview'));
18+
target_preview.attr('src', url).trigger('change');
19+
};
1120
return false;
1221
});
1322
}
1423

1524
})(jQuery);
16-
17-
18-
function SetUrl(url, file_path){
19-
//set the value of the desired input to image url
20-
var target_input = $('#' + localStorage.getItem('target_input'));
21-
target_input.val(file_path);
22-
23-
//set or change the preview image src
24-
var target_preview = $('#' + localStorage.getItem('target_preview'));
25-
target_preview.attr('src', url);
26-
}

0 commit comments

Comments
 (0)