PHP Classes

File: src/stubs/skin/theme1/theme/vendors/laravel-filemanager/js/lfm.js

Recommend this page to a friend!
  Classes of Shun Ram   Laravel Admin   src/stubs/skin/theme1/theme/vendors/laravel-filemanager/js/lfm.js   Download  
File: src/stubs/skin/theme1/theme/vendors/laravel-filemanager/js/lfm.js
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: Laravel Admin
Manage users and the site content they publish
Author: By
Last change:
Date: 1 year ago
Size: 938 bytes
 

Contents

Class file image Download
(function( $ ){ $.fn.filemanager = function(type, options) { type = type || 'file'; this.on('click', function(e) { var route_prefix = (options && options.prefix) ? options.prefix : '/laravel-filemanager'; localStorage.setItem('target_input', $(this).data('input')); localStorage.setItem('target_preview', $(this).data('preview')); window.open(route_prefix + '?type=' + type, 'FileManager', 'width=900,height=600'); window.SetUrl = function (url, file_path) { //set the value of the desired input to image url var target_input = $('#' + localStorage.getItem('target_input')); target_input.val(file_path).trigger('change'); //set or change the preview image src var target_preview = $('#' + localStorage.getItem('target_preview')); target_preview.attr('src', url).trigger('change'); }; return false; }); } })(jQuery);