Skip to content
This repository has been archived by the owner on Jan 25, 2021. It is now read-only.

Commit

Permalink
Small improvement for the image field
Browse files Browse the repository at this point in the history
  • Loading branch information
bastianallgeier committed Apr 7, 2016
1 parent dd1bf7f commit a2fe680
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 9 deletions.
10 changes: 10 additions & 0 deletions app/fields/image/assets/js/image.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,21 @@
var url = option.data('url');
var thumb = option.data('thumb');

if(option.val() == '') {
url = '#';
}

preview.attr('style', 'background-image: url(' + thumb + ')');
link.attr('href', url);

}).trigger('change');

field.find('.input-preview').on('click', function() {
if($(this).attr('href') == '#') {
return false;
}
});

field.find('.input').droppable({
hoverClass: 'over',
accept: $('.sidebar .draggable-file'),
Expand Down
10 changes: 10 additions & 0 deletions assets/js/dist/form.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,21 @@
var url = option.data('url');
var thumb = option.data('thumb');

if(option.val() == '') {
url = '#';
}

preview.attr('style', 'background-image: url(' + thumb + ')');
link.attr('href', url);

}).trigger('change');

field.find('.input-preview').on('click', function() {
if($(this).attr('href') == '#') {
return false;
}
});

field.find('.input').droppable({
hoverClass: 'over',
accept: $('.sidebar .draggable-file'),
Expand Down
2 changes: 1 addition & 1 deletion assets/js/dist/form.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 8 additions & 8 deletions assets/js/dist/panel.min.js

Large diffs are not rendered by default.

0 comments on commit a2fe680

Please sign in to comment.