jQuery: The Write Less, Do More JavaScript Library

Changeset 5508

Show
Ignore:
Timestamp:
05/08/08 17:31:30 (5 days ago)
Author:
paul.bakaus
Message:

ui-slider: added unwrap method, used in destroy to unwrap handles from <a> tags (fixes #2821)

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/ui/ui.slider.js

    r5507 r5508  
    1414 */ 
    1515;(function($) { 
     16 
     17    $.fn.unwrap = $.fn.unwrap || function(expr) { 
     18      return this.each(function(){ 
     19         $(this).parents(expr).eq(0).after(this).remove(); 
     20      }); 
     21    }; 
    1622 
    1723    $.widget("ui.slider", { 
     
    144150                .removeData("slider") 
    145151                .unbind(".slider"); 
    146             this.handle.mouse("destroy"); 
     152            this.handle 
     153                .unwrap("a") 
     154                .mouse("destroy"); 
    147155            this.generated && this.generated.remove(); 
    148156        }, 
     
    272280         
    273281        handleIndex: function() { 
    274             return this.handle.index(this.currentHandle[0]) 
     282            return this.handle.index(this.currentHandle[0]); 
    275283        }, 
    276284