Created
April 16, 2013 19:17
-
-
Save dallasbpeters/5398755 to your computer and use it in GitHub Desktop.
Our fixes for iOS-style-checkboxes.js
This file contains 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
iOSCheckbox.prototype.optionallyResize = function(mode) { | |
var newWidth, offLabelWidth, offSpan, onLabelWidth, onSpan; | |
+ var minSize = 30; | |
onSpan = this.onLabel.find('span'); | |
onLabelWidth = this._getDimension(onSpan, "width"); | |
+ if (onLabelWidth < minSize) { onLabelWidth = minSize; } | |
onLabelWidth += parseInt(onSpan.css('padding-left'), 10); | |
offSpan = this.offLabel.find('span'); | |
offLabelWidth = this._getDimension(offSpan, "width"); | |
+ if (onLabelWidth < minSize) { onLabelWidth = minSize; } | |
offLabelWidth += parseInt(offSpan.css('padding-right'), 10); | |
if (mode === "container") { | |
newWidth = onLabelWidth > offLabelWidth ? onLabelWidth : offLabelWidth; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment