Sha256: 362e6d248fb3ec3742d0ac0aac6dccb14377bd2e2d31272210b4a771474b3d34
Contents?: true
Size: 1.06 KB
Versions: 16
Compression:
Stored size: 1.06 KB
Contents
<% self.class.include RailsAdminImageManager::Engine.routes.url_helpers %> // Direct asset picker var rails_admin_image_manager = rails_admin_image_manager || {}; rails_admin_image_manager.AssetPicker = function(){ }; rails_admin_image_manager.AssetPicker.prototype = { showFinder: function(dom_id, options, file_id){ // open a popup var params = {}; params.CKEditor = 'picker'; // this is not CKEditor if (file_id > 0) { params.selectImage = file_id; } var url = addQueryString('<%= image_manager_index_path %>', params); window.open(url, 'filebrowser', "resizable=yes,scrollbars=yes,width=1024,height=700") }, setAsset: function(dom_id, asset, id, type){ var split_field_name = $(dom_id).attr('id').split('_') if (split_field_name[split_field_name.length - 1] == "id") { $(dom_id).val(id); } else { $(dom_id).val(asset); } if (type=='image') { $(dom_id).siblings('img.rich-image-preview').first().attr({src: asset}); } } }; // RailsAdminImageManager Asset input var assetPicker = new rails_admin_image_manager.AssetPicker();
Version data entries
16 entries across 16 versions & 1 rubygems