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 table { white-space: normal; }
|
||||
#Root_Documents table th.col-action_SetOrderTitle, #Root_Documents table th.col-FilenameWithoutID { width: 300px; }
|
||||
|
@ -3,42 +3,42 @@
|
||||
|
||||
$.entwine('ss', function($) {
|
||||
|
||||
$('.document-add-existing .document-autocomplete').entwine({
|
||||
onmatch: function() {
|
||||
var self = this;
|
||||
this.autocomplete({
|
||||
source: 'admin/pages/adddocument/documentautocomplete',
|
||||
select: function(event, ui) {
|
||||
if(ui.item) {
|
||||
var page_id = $(this).closest('form').find(':input[name=ID]').val();
|
||||
var document_id = ui.item.value;
|
||||
$('.document-add-existing .document-autocomplete').entwine({
|
||||
onmatch: function() {
|
||||
var self = this;
|
||||
this.autocomplete({
|
||||
source: 'admin/pages/adddocument/documentautocomplete',
|
||||
select: function(event, ui) {
|
||||
if(ui.item) {
|
||||
var page_id = $(this).closest('form').find(':input[name=ID]').val();
|
||||
var document_id = ui.item.value;
|
||||
|
||||
jQuery.ajax(
|
||||
'admin/pages/adddocument/linkdocument?ID=' + page_id + '&documentID=' + document_id,
|
||||
{
|
||||
dataType: 'json',
|
||||
success: function(data, textstatus) {
|
||||
var fn = window.tmpl.cache['ss-uploadfield-addtemplate'];
|
||||
var fnout = fn({
|
||||
files: [data],
|
||||
formatFileSize: function (bytes) {
|
||||
if (typeof bytes !== 'number') return '';
|
||||
if (bytes >= 1000000000) return (bytes / 1000000000).toFixed(2) + ' GB';
|
||||
if (bytes >= 1000000) return (bytes / 1000000).toFixed(2) + ' MB';
|
||||
return (bytes / 1000).toFixed(2) + ' KB';
|
||||
},
|
||||
options: self.fileupload('option')
|
||||
});
|
||||
jQuery.ajax(
|
||||
'admin/pages/adddocument/linkdocument?ID=' + page_id + '&documentID=' + document_id,
|
||||
{
|
||||
dataType: 'json',
|
||||
success: function(data, textstatus) {
|
||||
var fn = window.tmpl.cache['ss-uploadfield-addtemplate'];
|
||||
var fnout = fn({
|
||||
files: [data],
|
||||
formatFileSize: function (bytes) {
|
||||
if (typeof bytes !== 'number') return '';
|
||||
if (bytes >= 1000000000) return (bytes / 1000000000).toFixed(2) + ' GB';
|
||||
if (bytes >= 1000000) return (bytes / 1000000).toFixed(2) + ' MB';
|
||||
return (bytes / 1000).toFixed(2) + ' KB';
|
||||
},
|
||||
options: self.fileupload('option')
|
||||
});
|
||||
|
||||
$('.ss-add-files').append(fnout);
|
||||
$('.ss-add-files').append(fnout);
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
}(jQuery));
|
@ -60,7 +60,6 @@
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
||||
}(jQuery));
|
@ -1,5 +1,11 @@
|
||||
//data-icon="cross-circle"
|
||||
|
||||
#Main_FromtheCMS{
|
||||
.ss-uploadfield-item-edit{
|
||||
position: relative;
|
||||
}
|
||||
}
|
||||
|
||||
#Root_Documents{
|
||||
padding-left: 0;
|
||||
table{
|
||||
|
@ -1,4 +1,4 @@
|
||||
<div class="ss-add">
|
||||
<div class="ss-add ss-upload">
|
||||
<div class="document-add-existing field">
|
||||
|
||||
<h3>
|
||||
@ -8,7 +8,7 @@
|
||||
</span>
|
||||
</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 class="ss-assetuploadfield">
|
||||
|
Loading…
Reference in New Issue
Block a user