Skip to content

Commit

Permalink
#160. Changed _image_field_form_validate() to return if no image is p…
Browse files Browse the repository at this point in the history
…resent on field.
  • Loading branch information
signalpoint committed Sep 6, 2013
1 parent d2ea5da commit 5b1b6ee
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion modules/image/image.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ function _image_phonegap_camera_getPicture_success(options) {
function _image_field_form_validate(form, form_state) {
try {
$.each(form.image_fields, function(index, name){
// Skip empty images.
if (!image_phonegap_camera_options[name][0]) { return; }
// Create a unique file name using the UTC integer value.
var d = new Date();
var image_file_name = "" + d.valueOf() + ".jpg";
Expand All @@ -143,7 +145,6 @@ function _image_field_form_validate(form, form_state) {
});
});
dpm(form_state);
alert('_image_field_form_validate');
}
catch (error) { drupalgap_error(error); }
}
Expand Down
4 changes: 4 additions & 0 deletions modules/taxonomy/taxonomy.js
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,10 @@ function _theme_taxonomy_term_reference_load_items(options) {
if (terms.length > 0) {
$.each(terms, function(index, term){
var option = '<option value="' + term.tid + '">' + term.name + '</option>';
// TODO - this line of code searches the DOM on every iteration,
// the reference to the widget should be set to a variable
// before the loop. This performance improvement should be used
// probably hundreds of spots within DrupalGap, doh!
$('#' + options.widget_id).append(option);
});
}
Expand Down

0 comments on commit 5b1b6ee

Please sign in to comment.