Permalink
Browse files

Field Attr : bug fix

  • Loading branch information...
Sylvain Frigui
Sylvain Frigui committed Sep 8, 2015
1 parent baac385 commit 38c0cdd3196b1531d16ae5f8a47cf0f9478cbd51
Showing with 6 additions and 6 deletions.
  1. +6 −6 grandcentral/field/template/js/attr.js
@@ -4,16 +4,16 @@
$field = $('li[data-type="attr"]');
attrSelector = 'input[data-associative="attr"]';
label = 'label';
// Make sortable
// Make sortable
$field.sortable(
{
handle: '> .handle',
items: 'ol.data>li',
axis: 'y',
containment: 'parent',
});
// Some binds the key
$field.off('input', 'input[data-associative="attr"]').on('input', 'input[data-associative="attr"]', function()
{
@@ -31,13 +31,13 @@
{
input = $(this);
name = input.attr('name');
input.attr('name', name.replace(/\[attr\]\[[a-z0-9_-]*\]/i, "[attr]["+key+"]"));
input.attr('name', name.replace(/\[attr\]\[[^\[]*\]/i, "[attr]["+key+"]"));
});
});
// Expand
$field.on('click', label, function()
{
$(this).closest('ol').find('li:not(:first-child)').toggle('fast');
});
})(jQuery);
})(jQuery);

0 comments on commit 38c0cdd

Please sign in to comment.