Skip to content

Commit 07455de

Browse files
committed
Optimise header setup
The sections iterator neither needs to query twice just to get headerClass, nor needs to short twice.
1 parent 4826f5b commit 07455de

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

midnight.jquery.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,10 @@
115115
headers['default'] = {};
116116

117117
$sections.each(function(){
118-
if( typeof $(this).data('midnight') !== 'string' ) { return; }
118+
var headerClass = $section.data('midnight');
119119

120-
var headerClass = $(this).data('midnight');
121120
if( typeof headerClass !== 'string' ){ return; }
121+
122122
headerClass = headerClass.trim();
123123

124124
if( headerClass === '' ){ return; }
@@ -406,4 +406,4 @@
406406

407407
};
408408

409-
})(jQuery));
409+
})(jQuery));

0 commit comments

Comments
 (0)