Opened 13 years ago
Closed 10 years ago
#5001 closed feature (notabug)
Performance: ui.draggable uses repeated $( ) for same object
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | minor | Milestone: | 2.0.0 |
Component: | ui.draggable | Version: | 1.7.2 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
Multiple repeates of the same $() conversion is used throu out the module.
Eexample 1 (Line 275)
var ce = $(o.containment)[0]; if(!ce) return;
var co = $(o.containment).offset();
var over = ($(ce).css("overflow") != 'hidden');
This should probably be faster using a first single $()
var cont = $(o.containment);
var ce = cont[0]; if(!ce) return;
var co = cont.offset();
var over = ($(ce).css("overflow") != 'hidden');
The last row could possibly be replaced with cont if the original o.containment only results in a single element.
Example 2 (line 270)
$(o.containment == 'document' ? document : window).width()
($(o.containment == 'document' ? document : window).height()
Where the same $(o.containmend) is generated repeatedly.
Change History (4)
comment:1 Changed 13 years ago by
Milestone: | TBD → 1.8 |
---|
comment:2 Changed 11 years ago by
Type: | enhancement → feature |
---|
comment:3 Changed 10 years ago by
Milestone: | 1.9.0 → 2.0.0 |
---|
comment:4 Changed 10 years ago by
Resolution: | → notabug |
---|---|
Status: | new → closed |
Great suggestions. This will definitely be taken into account during the rewrite when this component is rewritten, so no need to track it.