Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No longer adjusts input width #3

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dist/wp-color-picker-alpha.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 0 additions & 13 deletions plugin/wp-color-picker-alpha/wp-color-picker-alpha.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,14 +198,6 @@
aSlider: aSlider
};

// Set default width for input reset
self.options.defaultWidth = el.width();

// Update width for input
if ( self._color._alpha < 1 || self._color.toString().indexOf('rgb') != 1 ) {
el.width( parseInt( self.options.defaultWidth+100 ) );
}

// Push new controls
$.each( controls, function( k, v ){
self.controls[k] = v;
Expand Down Expand Up @@ -262,7 +254,6 @@
'rgb(' + color.r + ',' + color.g + ',' + color.b + ') 0%',
'rgba(' + color.r + ',' + color.g + ',' + color.b + ', 0) 100%'
],
defaultWidth = self.options.defaultWidth,
target = self.picker.closest('.wp-picker-container').find( '.wp-color-result' );

// Generate background slider alpha, only for CSS3 old browser fuck!! :)
Expand All @@ -280,10 +271,6 @@
var style = controls.strip.attr( 'style' ).replace( /rgba\(([0-9]+,)(\s+)?([0-9]+,)(\s+)?([0-9]+)(,(\s+)?[0-9\.]+)\)/g, 'rgb($1$3$5)' );

controls.strip.attr( 'style', style );

el.width( parseInt( defaultWidth+100 ) );
} else {
el.width( defaultWidth );
}
}
}
Expand Down
13 changes: 0 additions & 13 deletions src/wp-color-picker-alpha.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,14 +198,6 @@
aSlider: aSlider
};

// Set default width for input reset
self.options.defaultWidth = el.width();

// Update width for input
if ( self._color._alpha < 1 || self._color.toString().indexOf('rgb') != 1 ) {
el.width( parseInt( self.options.defaultWidth+100 ) );
}

// Push new controls
$.each( controls, function( k, v ){
self.controls[k] = v;
Expand Down Expand Up @@ -262,7 +254,6 @@
'rgb(' + color.r + ',' + color.g + ',' + color.b + ') 0%',
'rgba(' + color.r + ',' + color.g + ',' + color.b + ', 0) 100%'
],
defaultWidth = self.options.defaultWidth,
target = self.picker.closest('.wp-picker-container').find( '.wp-color-result' );

// Generate background slider alpha, only for CSS3 old browser fuck!! :)
Expand All @@ -280,10 +271,6 @@
var style = controls.strip.attr( 'style' ).replace( /rgba\(([0-9]+,)(\s+)?([0-9]+,)(\s+)?([0-9]+)(,(\s+)?[0-9\.]+)\)/g, 'rgb($1$3$5)' );

controls.strip.attr( 'style', style );

el.width( parseInt( defaultWidth+100 ) );
} else {
el.width( defaultWidth );
}
}
}
Expand Down