mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
BUGFIX "Insert media" loading indicator (fixes #7542)
No "working" indicator in insert media from web button. Returning the $.ajax object to allow for deferred callbacks on events other than 'success'
This commit is contained in:
parent
5713a37a32
commit
682a6a0d1b
@ -553,6 +553,7 @@ body.cms-dialog { overflow: auto; background: url("../images/textures/bg_cms_mai
|
|||||||
.htmleditorfield-dialog #MediaFormInsertMediaTabs_Fromtheweb button.add-url .btn-icon-addMedia { width: 20px; height: 20px; }
|
.htmleditorfield-dialog #MediaFormInsertMediaTabs_Fromtheweb button.add-url .btn-icon-addMedia { width: 20px; height: 20px; }
|
||||||
.htmleditorfield-dialog #MediaFormInsertMediaTabs_Fromtheweb button.add-url:hover, .htmleditorfield-dialog #MediaFormInsertMediaTabs_Fromtheweb button.add-url:active { border: none; -moz-box-shadow: none; -webkit-box-shadow: none; box-shadow: none; opacity: 1; }
|
.htmleditorfield-dialog #MediaFormInsertMediaTabs_Fromtheweb button.add-url:hover, .htmleditorfield-dialog #MediaFormInsertMediaTabs_Fromtheweb button.add-url:active { border: none; -moz-box-shadow: none; -webkit-box-shadow: none; box-shadow: none; opacity: 1; }
|
||||||
.htmleditorfield-dialog #MediaFormInsertMediaTabs_Fromtheweb button.add-url.ui-state-disabled, .htmleditorfield-dialog #MediaFormInsertMediaTabs_Fromtheweb button.add-url.ui-state-disabled:hover, .htmleditorfield-dialog #MediaFormInsertMediaTabs_Fromtheweb button.add-url.ui-state-disabled:active { opacity: 0.35; filter: Alpha(Opacity=35); }
|
.htmleditorfield-dialog #MediaFormInsertMediaTabs_Fromtheweb button.add-url.ui-state-disabled, .htmleditorfield-dialog #MediaFormInsertMediaTabs_Fromtheweb button.add-url.ui-state-disabled:hover, .htmleditorfield-dialog #MediaFormInsertMediaTabs_Fromtheweb button.add-url.ui-state-disabled:active { opacity: 0.35; filter: Alpha(Opacity=35); }
|
||||||
|
.htmleditorfield-dialog #MediaFormInsertMediaTabs_Fromtheweb .loading button.add-url .ui-icon { background-image: url(../images/throbber.gif); background-position: 50% 50%; background-repeat: no-repeat; }
|
||||||
.htmleditorfield-dialog .cms-content-header { padding: 0; width: 100%; height: 40px; }
|
.htmleditorfield-dialog .cms-content-header { padding: 0; width: 100%; height: 40px; }
|
||||||
.htmleditorfield-dialog .cms-content-header h3 { padding: 0 8px; margin: 10px; }
|
.htmleditorfield-dialog .cms-content-header h3 { padding: 0 8px; margin: 10px; }
|
||||||
.htmleditorfield-dialog .ui-tabs { position: static; }
|
.htmleditorfield-dialog .ui-tabs { position: static; }
|
||||||
|
@ -1452,7 +1452,7 @@ body.cms-dialog {
|
|||||||
float:left;
|
float:left;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
||||||
label {
|
label {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: 8px;
|
left: 8px;
|
||||||
top: 13px;
|
top: 13px;
|
||||||
@ -1491,6 +1491,12 @@ body.cms-dialog {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.loading button.add-url .ui-icon {
|
||||||
|
background-image: url(../images/throbber.gif);
|
||||||
|
background-position: 50% 50%;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.cms-content-header{
|
.cms-content-header{
|
||||||
|
@ -762,7 +762,7 @@ ss.editorWrappers['default'] = ss.editorWrappers.tinyMCE;
|
|||||||
|
|
||||||
// TODO Depends on managed mime type
|
// TODO Depends on managed mime type
|
||||||
if(node.is('img')) {
|
if(node.is('img')) {
|
||||||
this.showFileView(node.data('url') || node.attr('src'), function() {
|
this.showFileView(node.data('url') || node.attr('src')).complete(function() {
|
||||||
$(this).updateFromNode(node);
|
$(this).updateFromNode(node);
|
||||||
self.toggleCloseButton();
|
self.toggleCloseButton();
|
||||||
self.redraw();
|
self.redraw();
|
||||||
@ -811,7 +811,7 @@ ss.editorWrappers['default'] = ss.editorWrappers.tinyMCE;
|
|||||||
|
|
||||||
item.addClass('loading');
|
item.addClass('loading');
|
||||||
this.find('.content-edit').append(item);
|
this.find('.content-edit').append(item);
|
||||||
$.ajax({
|
return $.ajax({
|
||||||
// url: this.data('urlViewfile') + '?ID=' + id,
|
// url: this.data('urlViewfile') + '?ID=' + id,
|
||||||
url: $.path.addSearchParams(this.attr('action').replace(/MediaForm/, 'viewfile'), params),
|
url: $.path.addSearchParams(this.attr('action').replace(/MediaForm/, 'viewfile'), params),
|
||||||
success: function(html, status, xhr) {
|
success: function(html, status, xhr) {
|
||||||
@ -908,11 +908,13 @@ ss.editorWrappers['default'] = ss.editorWrappers.tinyMCE;
|
|||||||
},
|
},
|
||||||
|
|
||||||
onclick: function(e) {
|
onclick: function(e) {
|
||||||
var urlField = this.getURLField();
|
var urlField = this.getURLField(), container = this.closest('.CompositeField'), form = this.closest('form');
|
||||||
|
|
||||||
if (urlField.validate()) {
|
if (urlField.validate()) {
|
||||||
var form = this.closest('form');
|
container.addClass('loading');
|
||||||
form.showFileView('http://' + urlField.val());
|
form.showFileView('http://' + urlField.val()).complete(function() {
|
||||||
|
container.removeClass('loading');
|
||||||
|
});
|
||||||
form.redraw();
|
form.redraw();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user