Comments (7)
@JakeCowton Do you have somewhere the tmp fix we have done together on your machine?
from invenio.
Yes.
/**
* Update the value of a field to a new one.
*/
function handle_field_values(name, value) {
if (name == 'files'){
$.each(value, function(i, file){
id = unique_id();
new_file = {
id: id,
name: file.name,
size: file.size
};
$('#filelist').append(tpl_file_entry.render({
id: id,
filename: file.name,
filesize: getBytesWithUnit(file.size)
}));
$('#filelist #' + id).show('fast');
});
$('#file-table').show('fast');
} else {
clear_error(name);
has_ckeditor = $('[name=' + name + ']').data('ckeditor');
if( has_ckeditor === 1) {
if(CKEDITOR.instances[name].getData(value) != value) {
CKEDITOR.instances[name].setData(value);
}
} else if (field_lists !== undefined && name in field_lists &&
value instanceof Array) {
var $field = $('#'+name)
if ($field.hasClass('dynamic-field-list')) {
// TODO check that number of dynamic fields in the list is greather or equal to value.length
// #<name> a.add-element .click()
if ($field.children('.field-list-element').length < value.length) {
$field.children('.add-element').click();
}
}
for(var i = 0; i < value.length; i++){
field_lists[name].update_element(value[i], i);
}
} else {
if($('[name=' + name + ']').val() != value) {
$('[name=' + name + ']').val(value);
}
}
}
from invenio.
@JakeCowton A patch would be better.
from invenio.
From 5988a55a3fb8842853393a07a4ea290f6f36bc44 Mon Sep 17 00:00:00 2001
From: Jake Cowton <[email protected]>
Date: Tue, 25 Mar 2014 17:46:13 +0100
Subject: [PATCH 2/2] Data Analysis: Initial Commit
---
invenio/modules/deposit/static/js/deposit/form.js | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/invenio/modules/deposit/static/js/deposit/form.js b/invenio/modules/deposit/static/js/deposit/form.js
index dd07282..77618e5 100644
--- a/invenio/modules/deposit/static/js/deposit/form.js
+++ b/invenio/modules/deposit/static/js/deposit/form.js
@@ -282,6 +282,16 @@ var DEPOSIT_FORM = (function( $ ){
}
} else if (field_lists !== undefined && name in field_lists &&
value instanceof Array) {
+
+ var $field = $('#'+name)
+ if ($field.hasClass('dynamic-field-list')) {
+ // TODO check that number of dynamic fields in the list is greather or equal to value.length
+ // #<name> a.add-element .click()
+ if ($field.children('.field-list-element').length < value.length) {
+ $field.children('.add-element').click();
+ }
+ }
+
for(var i = 0; i < value.length; i++){
field_lists[name].update_element(value[i], i);
}
--
1.9.1
from invenio.
@jirikuncar do you have any ideas what the problem here could be?
from invenio.
// TODO check that number of dynamic fields in the list is greather or equal to value.length
Have you implemented the TODO?
from invenio.
Yes. It's the two lines below.
from invenio.
Related Issues (20)
- accounts: remove email editing option
- Issue with 404 for /fonts/* (glyphicons broken) HOT 8
- div in messages menu HOT 1
- RFC: fixtures loading from inveniomanage HOT 21
- RFC: Invenio new uploader
- groups: new REST API for admins
- SQLAlchemy: default constructor on types does not accept arguments
- record_editor: missing javascript files HOT 2
- default installed js/jquery.hotkeys.js breaks the Record Editor
- record_editor: cannot submit changes - Internal error HOT 1
- oaiharvest: replace jquery.treeview with jqTree
- groups: port missing functionality
- travis: less verbose pip install HOT 1
- RFC oauth2server: defining scopes in registry HOT 11
- RFC deposit: authors field in article submission form
- RFC deposit: form.js modularisation
- search: port get_collectionbox_name for templates
- RFC Arxiv extension: replacing or extending import source HOT 1
- RFC: Login/Register vs Sign in/Sign up
- bibrecord: error caused by conversion to ascii string HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from invenio.