Skip to content

Commit

Permalink
Normalize whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
jugglinmike committed May 28, 2015
1 parent de724e3 commit feaf17f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
1 change: 0 additions & 1 deletion Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -746,7 +746,6 @@ $('li').wrap(healthy)
// </ul>
```


#### .css( [propertName] ) <br /> .css( [ propertyNames] ) <br /> .css( [propertyName], [value] ) <br /> .css( [propertName], [function] ) <br /> .css( [properties] )

Get the value of a style property for the first element in the set of matched elements or set one or more CSS properties for every matched element.
Expand Down
8 changes: 4 additions & 4 deletions lib/api/manipulation.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,10 @@ exports.wrap = function(wrapper) {
var self = this,
elemNumber = self.length;

_.times(elemNumber, function(i) {
_.times(elemNumber, function(i) {
if ( i > 0 ) wrapper = wrapper.clone();
var el = self[i],

var el = self[i],
parent = el.parent || el.root,
siblings = parent.children,
dom = self._makeDomArray(typeof wrapper === 'function' ? wrapper.call(el, i, el) : wrapper),
Expand All @@ -126,7 +126,7 @@ exports.wrap = function(wrapper) {

updateDOM(dom, null);
index = siblings.indexOf(el);

var oldEl = uniqueSplice(siblings, index, 1, dom, parent);
wrapper.prepend(oldEl);
el.parent = el.prev = el.next = el.root = null;
Expand Down
8 changes: 4 additions & 4 deletions test/api/manipulation.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ describe('$(...)', function() {
$fruits = $('#fruits');
});

describe('.wrap', function(){
it ('(elem) : should insert the element and add selected element(s) as it\'s child', function(){
describe('.wrap', function() {
it('(elem) : should insert the element and add selected element(s) as it\'s child', function() {
var $redFruits = $('<div class="red-fruits"></div>');
$('.apple').wrap($redFruits);

Expand All @@ -23,15 +23,15 @@ describe('$(...)', function() {
expect($redFruits.children()).to.have.length(1);
});

it.skip ('(elem) : should insert the element and add selected element(s) as it\'s child and should accept html', function(){
it.skip('(elem) : should insert the element and add selected element(s) as it\'s child and should accept html', function() {
$('.apple').wrap('<div class="red-fruits"> </div>');
expect($fruits.children().eq(0).hasClass('red-fruits')).to.be.ok();
expect($('.red-fruits').children().eq(0).hasClass('apple')).to.be.ok();
expect($fruits.children().eq(1).hasClass('orange')).to.be.ok();
expect($('.red-fruits').children()).to.have.length(1);
});

it ('($(...)) : for each element it should add a wrapper elment and add the selected element as it\'s child', function(){
it('($(...)) : for each element it should add a wrapper elment and add the selected element as it\'s child', function() {
var $fruitDecorator = $('<div class="fruit-decorator"></div>');
$('li').wrap($fruitDecorator);
expect($fruits.children().eq(0).hasClass('fruit-decorator')).to.be.ok();
Expand Down

0 comments on commit feaf17f

Please sign in to comment.