Created
August 10, 2011 21:42
-
-
Save jdlich/1138352 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var up = up || {}; | |
(function($, fluid){ | |
var initialHide = function (that) { | |
$(that.locate("stacktracediv")).hide(); | |
}; | |
var addToggle = function (that) { | |
var toggleHandle = $(that.locate("stacktracetoggle")); | |
var stacktracediv = $(that.locate("stacktracediv")); | |
var hideMesg = that.options.hidemessage; | |
var showMesg = that.options.showmessage; | |
toggleHandle.toggle( | |
function() { | |
stacktracediv.show('fast', function() { | |
toggleHandle.text(hideMesg); | |
}); | |
}, | |
function() { | |
stacktracediv.hide('fast', function() { | |
toggleHandle.text(showMesg); | |
}); | |
} | |
); | |
} | |
up.showHideToggle = function(container, options) { | |
var that = fluid.initView("up.showHideToggle", container, options); | |
initialHide(that); | |
addToggle(that); | |
return that; | |
}; | |
fluid.defaults("up.showHideToggle", { | |
showmessage: 'Show Stack Trace', | |
hidemessage: 'Hide Stack Trace', | |
selectors: { | |
stacktracediv: '.stacktrace', | |
stacktracetoggle: '.stacktracetoggle' | |
} | |
}); | |
})(jQuery, fluid); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment