Sha256: 551772ac7de9ae61dd1c85893b85c9a6a82493aa2a80e7b5540516a91c934a48
Contents?: true
Size: 1.27 KB
Versions: 30
Compression:
Stored size: 1.27 KB
Contents
// ========================================================================== // Project: SproutCore - JavaScript Application Framework // Copyright: ©2006-2011 Strobe Inc. and contributors. // Portions ©2008-2011 Apple Inc. All rights reserved. // License: Licensed under MIT license (see license.js) // ========================================================================== module("jQuery Buffer -- setClass"); // Buffered jQuery tries to call runloop, so we need a dummy runloop. SC = {}; SC.RunLoop = {}; SC.RunLoop.currentRunLoop = {}; SC.RunLoop.currentRunLoop.invokeOnce = function(){}; test("Setting class on an element", function() { var sel = $.bufferedJQuery("<div></div>"); sel.setClass('abc', true); jQuery.Buffer.flush(); ok(sel[0].className.indexOf("abc") > -1, "Set the class name"); sel.setClass('abc', false); jQuery.Buffer.flush(); ok(sel[0].className.indexOf("abc") == -1, "Unset the class name"); }); test("Setting to undefined unsets", function() { var sel = $.bufferedJQuery("<div></div>"); sel.setClass('abc', true); jQuery.Buffer.flush(); ok(sel[0].className.indexOf("abc") > -1, "Set the class name"); sel.setClass('abc'); jQuery.Buffer.flush(); ok(sel[0].className.indexOf("abc") == -1, "Unset the class name"); });
Version data entries
30 entries across 30 versions & 1 rubygems