Skip to content

Commit

Permalink
Icon size relative to button size and padding ratio fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
shramee committed Mar 1, 2016
1 parent 43972c1 commit cb1568a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
7 changes: 6 additions & 1 deletion assets/dashicons-select.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@
$di.append( $('<br>') );
$.each( $.fn.dashicons, function( k, icon ) {
var ico = 'dashicons dashicons-' + icon;
$i = $( '<i/>' ).addClass( ico ).css("vertical-align","middle");
$i = $( '<i/>' ).addClass( ico ).css( {
verticalAlign : "middle",
fontSize: '1.2em',
width: '1em',
height: '1em'
} );
$i.click( function() {
var $t = $( this );
$input.val( $t.prop('outerHTML') ).change();
Expand Down
10 changes: 5 additions & 5 deletions assets/dialog.php
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@
</div>
<div class="field">
<label>Size</label>
<input class="input-style" name="font-size" min="5" max="70" step="2" type="range">
<input class="input-style" name="font-size" min="5" max="70" step="2" type="range" value="25">
</div>
<div class="field">
<label>Align</label>
Expand All @@ -236,7 +236,7 @@
<?php wp_print_footer_scripts(); ?>
<script src="<?php echo $_GET['assets_url'] . 'alpha-color.js' ?>"></script>
<link rel="stylesheet" href="<?php echo $_GET['assets_url'] . 'dashicons-select.css' ?>">
<script src="<?php echo $_GET['assets_url'] . 'dashicons-select.js?v=1.1' ?>"></script>
<script src="<?php echo $_GET['assets_url'] . 'dashicons-select.js?v=1.0.1' ?>"></script>

<script>
jQuery( function ( $ ) {
Expand Down Expand Up @@ -267,7 +267,6 @@
var $t = $( this ),
name = $t.attr( 'name' ),
val = params.button.attr( name );
console.log( name + ' : ' + val );
if ( val ) {
if ( 'checkbox' == $t.attr( 'type' ) ) {
$t.prop( 'checked', true );
Expand Down Expand Up @@ -316,7 +315,7 @@

return_text += $t.attr( 'name' ) + ':' + val + ';';
} );
return return_text + get_background() + 'display:inline-block;padding:0.5em 1em;text-decoration:none;line-height:1;';
return return_text + get_background() + 'display:inline-block;padding:0.5em 0.7em;text-decoration:none;line-height:1;';
};

get_background = function () {
Expand All @@ -337,7 +336,8 @@
$( 'input[type="colorpicker"]' ).each( function () {
var $t = $( this );
$t.libColorPicker( {
change: preview
change: preview,
clear: preview
} );
} );

Expand Down

0 comments on commit cb1568a

Please sign in to comment.