mirror of
https://github.com/silverstripe/silverstripe-dms
synced 2024-10-22 14:05:56 +02:00
ENHANCEMENT: Add styling for linking documents. Add classes for framework js to work
This commit is contained in:
parent
043eb540c1
commit
34674059f6
@ -1,3 +1,5 @@
|
|||||||
|
#Main_FromtheCMS .ss-uploadfield-item-edit { position: relative; }
|
||||||
|
|
||||||
#Root_Documents { padding-left: 0; }
|
#Root_Documents { padding-left: 0; }
|
||||||
#Root_Documents table { white-space: normal; }
|
#Root_Documents table { white-space: normal; }
|
||||||
#Root_Documents table th.col-action_SetOrderTitle, #Root_Documents table th.col-FilenameWithoutID { width: 300px; }
|
#Root_Documents table th.col-action_SetOrderTitle, #Root_Documents table th.col-FilenameWithoutID { width: 300px; }
|
||||||
|
@ -3,42 +3,42 @@
|
|||||||
|
|
||||||
$.entwine('ss', function($) {
|
$.entwine('ss', function($) {
|
||||||
|
|
||||||
$('.document-add-existing .document-autocomplete').entwine({
|
$('.document-add-existing .document-autocomplete').entwine({
|
||||||
onmatch: function() {
|
onmatch: function() {
|
||||||
var self = this;
|
var self = this;
|
||||||
this.autocomplete({
|
this.autocomplete({
|
||||||
source: 'admin/pages/adddocument/documentautocomplete',
|
source: 'admin/pages/adddocument/documentautocomplete',
|
||||||
select: function(event, ui) {
|
select: function(event, ui) {
|
||||||
if(ui.item) {
|
if(ui.item) {
|
||||||
var page_id = $(this).closest('form').find(':input[name=ID]').val();
|
var page_id = $(this).closest('form').find(':input[name=ID]').val();
|
||||||
var document_id = ui.item.value;
|
var document_id = ui.item.value;
|
||||||
|
|
||||||
jQuery.ajax(
|
jQuery.ajax(
|
||||||
'admin/pages/adddocument/linkdocument?ID=' + page_id + '&documentID=' + document_id,
|
'admin/pages/adddocument/linkdocument?ID=' + page_id + '&documentID=' + document_id,
|
||||||
{
|
{
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
success: function(data, textstatus) {
|
success: function(data, textstatus) {
|
||||||
var fn = window.tmpl.cache['ss-uploadfield-addtemplate'];
|
var fn = window.tmpl.cache['ss-uploadfield-addtemplate'];
|
||||||
var fnout = fn({
|
var fnout = fn({
|
||||||
files: [data],
|
files: [data],
|
||||||
formatFileSize: function (bytes) {
|
formatFileSize: function (bytes) {
|
||||||
if (typeof bytes !== 'number') return '';
|
if (typeof bytes !== 'number') return '';
|
||||||
if (bytes >= 1000000000) return (bytes / 1000000000).toFixed(2) + ' GB';
|
if (bytes >= 1000000000) return (bytes / 1000000000).toFixed(2) + ' GB';
|
||||||
if (bytes >= 1000000) return (bytes / 1000000).toFixed(2) + ' MB';
|
if (bytes >= 1000000) return (bytes / 1000000).toFixed(2) + ' MB';
|
||||||
return (bytes / 1000).toFixed(2) + ' KB';
|
return (bytes / 1000).toFixed(2) + ' KB';
|
||||||
},
|
},
|
||||||
options: self.fileupload('option')
|
options: self.fileupload('option')
|
||||||
});
|
});
|
||||||
|
|
||||||
$('.ss-add-files').append(fnout);
|
$('.ss-add-files').append(fnout);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
);
|
||||||
);
|
}
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
});
|
}
|
||||||
}
|
});
|
||||||
});
|
|
||||||
|
|
||||||
});
|
});
|
||||||
}(jQuery));
|
}(jQuery));
|
@ -60,7 +60,6 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
}(jQuery));
|
}(jQuery));
|
@ -1,5 +1,11 @@
|
|||||||
//data-icon="cross-circle"
|
//data-icon="cross-circle"
|
||||||
|
|
||||||
|
#Main_FromtheCMS{
|
||||||
|
.ss-uploadfield-item-edit{
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#Root_Documents{
|
#Root_Documents{
|
||||||
padding-left: 0;
|
padding-left: 0;
|
||||||
table{
|
table{
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<div class="ss-add">
|
<div class="ss-add ss-upload">
|
||||||
<div class="document-add-existing field">
|
<div class="document-add-existing field">
|
||||||
|
|
||||||
<h3>
|
<h3>
|
||||||
@ -8,7 +8,7 @@
|
|||||||
</span>
|
</span>
|
||||||
</h3>
|
</h3>
|
||||||
|
|
||||||
<input class="document-autocomplete" placeholder="Search by ID or filename" />
|
<input class="document-autocomplete text" type="text" placeholder="Search by ID or filename" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="ss-assetuploadfield">
|
<div class="ss-assetuploadfield">
|
||||||
|
Loading…
Reference in New Issue
Block a user