Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fix: previous commit broke for items that were added after make_edita…

…ble() was called.
  • Loading branch information...
commit bdaea23d5c724007ea6dad05a127b798e0812a1c 1 parent 4b68b72
@knipknap authored
Showing with 6 additions and 7 deletions.
  1. +2 −2 index.html
  2. +4 −5 spiffform/spiffform.js
View
4 index.html
@@ -65,8 +65,8 @@
"cursorAt": {'right': -5},
"stop": function(event, ui) {
var cls = spiffform_elements[$(this).attr('name')];
- form.insert_at(event, new cls());
- this.select(obj);
+ var obj = form.insert_at(event, new cls());
+ form.select(obj);
}
});
});
View
9 spiffform/spiffform.js
@@ -1097,10 +1097,12 @@ var SpiffForm = function(div) {
var handle = obj.get_handle();
var elem = $('<li class="spiffform-item spiffform-item-' + handle + '"></li>');
elem.data('obj', obj);
+ obj.attach(elem);
elem.click(function(e) {
+ if (!$(e.target).is('input,textarea,select'))
+ that._div.find(':focus').blur();
return that.trigger('clicked', [e, obj]);
});
- obj.attach(elem);
return elem;
};
@@ -1149,6 +1151,7 @@ var SpiffForm = function(div) {
// Dropped on the form, but not on the element list.
this._div.find('.spiffform-elements').append(elem);
}
+ return obj;
};
this.make_editable = function(panel) {
@@ -1172,15 +1175,11 @@ var SpiffForm = function(div) {
that.unselect();
});
that.bind('clicked', function(e, obj) {
- that._div.find(':focus').blur();
that.select(obj);
return false;
});
// Initialize keyboard events.
- that._div.find('input,select,textarea').click(function() {
- return false;
- });
$(document).keydown(function(event) {
if ($('input,select,textarea').is(':focus'))
return;
Please sign in to comment.
Something went wrong with that request. Please try again.