Skip to content

Commit

Permalink
Issue #91: Postpone rendering attribute value table on modal until it…
Browse files Browse the repository at this point in the history
…'s parent div is visible to prevent sort column sizing artifacts.
  • Loading branch information
mk23 committed Mar 10, 2016
1 parent 6083ab3 commit 395c1df
Showing 1 changed file with 20 additions and 13 deletions.
33 changes: 20 additions & 13 deletions src/main/resources/assets/js/jmxproxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -368,18 +368,10 @@ var endpointHostClass = function(prefix, host) {
container: 'body',
})
.click(function() {
$('#attrib-name').text($(this).data('attrib-name'));
if ($('#attrib-data').data('fu.repeater')) {
$('#attrib-data')
.repeater('clear')
.removeData('fu.repeater');
}
$('#attrib-data').repeater({
dataSource: attrDataSource,
dataTarget: $(this).data('attrib-data'),
list_columnRendered: attrColBuilder,
});
$('#attrib-modal').modal();
$('#attrib-modal')
.data('attrib-name', $(this).data('attrib-name'))
.data('attrib-data', $(this).data('attrib-data'))
.modal();
})
.addClass('btn btn-xs btn-info')
.text($.type(val))
Expand Down Expand Up @@ -477,7 +469,7 @@ var endpointHostClass = function(prefix, host) {
})
}
} else if (_.isObject(data)) {
var cols = [{
cols = [{
label: 'Name',
property: 'key',
sortable: true,
Expand Down Expand Up @@ -551,6 +543,21 @@ var endpointHostClass = function(prefix, host) {
.click(function() {
buildBeanData($(this).data('target'));
});

$('#attrib-modal')
.on('hidden.bs.modal', function() {
$('#attrib-data')
.repeater('clear')
.removeData('fu.repeater');
})
.on('shown.bs.modal', function() {
$('#attrib-name').text($(this).data('attrib-name'));
$('#attrib-data').repeater({
dataSource: attrDataSource,
dataTarget: $(this).data('attrib-data'),
list_columnRendered: attrColBuilder,
});
});
});
};

Expand Down

0 comments on commit 395c1df

Please sign in to comment.