From 366a54bfe34e53c00ceda843d5b06251b27cf029 Mon Sep 17 00:00:00 2001 From: Andrey Kutejko Date: Sun, 4 Jan 2015 21:14:13 +0200 Subject: [PATCH] enable select'n'close button only when file is selected --- ipf/admin/assets/css/base.css | 2 ++ ipf/admin/assets/js/filebrowser_popup.js | 3 ++- ipf/admin/templates/admin/filebrowser.html | 15 ++++++++------- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/ipf/admin/assets/css/base.css b/ipf/admin/assets/css/base.css index e9bbad6..e0ff9ce 100644 --- a/ipf/admin/assets/css/base.css +++ b/ipf/admin/assets/css/base.css @@ -88,6 +88,8 @@ input[type=submit]:active, input[type=button]:active { background: linear-gradie input[type=submit].default, .submit-row input.default { border:2px solid #006a95; background: linear-gradient(to top, #0091cc, #00a3e6 16px); font-weight:bold; color:white; } input[type=submit].default:active { background: linear-gradient(to bottom, #0091cc, #00a3e6 16px); } +input[type=submit]:disabled, input[type=button]:disabled { background: #e1e1e1; color: #888; } + /* MODULES */ .module { border:1px solid #ccc; margin-bottom:5px; background:white; } .module p, .module ul, .module h3, .module h4, .module dl, .module pre { padding-left:10px; padding-right:10px; } diff --git a/ipf/admin/assets/js/filebrowser_popup.js b/ipf/admin/assets/js/filebrowser_popup.js index a9d4ae9..861aa19 100644 --- a/ipf/admin/assets/js/filebrowser_popup.js +++ b/ipf/admin/assets/js/filebrowser_popup.js @@ -10,7 +10,8 @@ function fileSelected(event) { var filename = row.data('name'); selected_url = url; - $('#picname').show(); + $('.file-selected').show(); + $('.select-and-close').removeAttr('disabled'); $('#id_old_name').val(filename); $('#id_old_name2').val(filename); $('#id_new_name').val(filename); diff --git a/ipf/admin/templates/admin/filebrowser.html b/ipf/admin/templates/admin/filebrowser.html index 21760fa..1285655 100644 --- a/ipf/admin/templates/admin/filebrowser.html +++ b/ipf/admin/templates/admin/filebrowser.html @@ -26,6 +26,8 @@ #prop { display:none; position:absolute; left:0; top:0; z-index:400000; border:2px solid #aaa; background: #888; } #prop img {max-width:100px;max-height:100px} + + .file-selected {display: none} {/literal} @@ -53,7 +55,7 @@ - @@ -146,7 +147,7 @@
- +
-- 2.49.0