ENHANCEMENT: Add styling for linking documents. Add classes for framework js to work

This commit is contained in:
Ryan O'Hara 2012-08-10 14:58:26 +12:00
parent 043eb540c1
commit 34674059f6
5 changed files with 42 additions and 35 deletions

View File

@ -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; }

View File

@ -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));

View File

@ -60,7 +60,6 @@
} }
}); });
}); });
}(jQuery)); }(jQuery));

View File

@ -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{

View File

@ -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">