Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modifiable processing element #209

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions jquery.dynatable.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@
recordCountText: 'Showing',
recordCountTextTemplate: '{text} {pageTemplate} {totalTemplate} {filteredTemplate}',
recordCountTemplate: '<span id="dynatable-record-count-{elementId}" class="dynatable-record-count">{textTemplate}</span>',
processingTemplate: '<span>{text}</span>',
processingText: 'Processing...'
},
dataset: {
Expand Down Expand Up @@ -775,8 +776,12 @@
};

this.create = function() {
var html = utility.template(settings.inputs.processingTemplate, {
text: settings.inputs.processingText
});

var $processing = $('<div></div>', {
html: '<span>' + settings.inputs.processingText + '</span>',
html: html,
id: 'dynatable-processing-' + obj.element.id,
'class': 'dynatable-processing',
style: 'position: absolute; display: none;'
Expand All @@ -787,7 +792,7 @@

this.position = function() {
var $processing = $('#dynatable-processing-' + obj.element.id),
$span = $processing.children('span'),
$span = $processing.find('>:first-child'),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this selector change going to cause issues for calculating the total height of the processing indicator, if someone changes the template to be multiple sibling elements on the top level? E.g., if I call dynatable with processingTemplate: '<div>{text}</div><div>Please hold on</div>, this selector will only grab the first div. Maybe we want to change this line to be:

$span = $processing.children()

?

spanHeight = $span.outerHeight(),
spanWidth = $span.outerWidth(),
$covered = obj.$element,
Expand Down