Skip to content
Browse files

screw.builder updated

  • Loading branch information...
1 parent 5e339f0 commit 7be30266075afd068fa8faab2832b5945f8dd39c @bartaz committed
Showing with 18 additions and 20 deletions.
  1. +18 −20 lib/screw.builder.js
View
38 lib/screw.builder.js
@@ -18,12 +18,12 @@ var Screw = (function($) {
context: [],
describe: function(name, fn) {
- var describe = $('<li class="describe"></li>')
- .append($('<h1></h1>').text(name))
- .append('<ol class="befores"></ol>')
- .append('<ul class="its"></ul>')
- .append('<ul class="describes"></ul>')
- .append('<ol class="afters"></ol>');
+ var describe = $('<li class="describe">')
+ .append($('<h1>').text(name))
+ .append('<ol class="befores">')
+ .append('<ul class="its">')
+ .append('<ul class="describes">')
+ .append('<ol class="afters">');
this.context.push(describe);
fn.call();
@@ -35,8 +35,8 @@ var Screw = (function($) {
},
it: function(name, fn) {
- var it = $('<li class="it"></li>')
- .append($('<h2></h2>').text(name))
+ var it = $('<li class="it">')
+ .append($('<h2>').text(name))
.data('screwunit.run', fn);
this.context[this.context.length-1]
@@ -45,7 +45,7 @@ var Screw = (function($) {
},
before: function(fn) {
- var before = $('<li class="before"></li>')
+ var before = $('<li class="before">')
.data('screwunit.run', fn);
this.context[this.context.length-1]
@@ -54,7 +54,7 @@ var Screw = (function($) {
},
after: function(fn) {
- var after = $('<li class="after"></li>')
+ var after = $('<li class="after">')
.data('screwunit.run', fn);
this.context[this.context.length-1]
@@ -65,18 +65,16 @@ var Screw = (function($) {
};
$(screw).queue(function() { $(screw).trigger('loading') });
-
- $(window).load(function(){
- $('<div class="describe"></div>')
- .append('<h3 class="status"></h3>')
- .append('<ol class="befores"></ol>')
- .append('<ul class="describes"></ul>')
- .append('<ol class="afters"></ol>')
+ $(function() {
+ $('<div class="describe">')
+ .append('<h3 class="status">')
+ .append('<ol class="befores">')
+ .append('<ul class="describes">')
+ .append('<ol class="afters">')
.appendTo('body');
-
+
$(screw).dequeue();
$(screw).trigger('loaded');
});
-
return screw;
-})(jQuery);
+})(jQuery);

0 comments on commit 7be3026

Please sign in to comment.
Something went wrong with that request. Please try again.