Skip to content

Commit

Permalink
Tag interface for IP Address input
Browse files Browse the repository at this point in the history
  • Loading branch information
Luke Carbis committed Jul 8, 2014
1 parent 7ea658b commit 51c7033
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ui/css/admin.css
Expand Up @@ -260,6 +260,7 @@
display: none;
}


/* Date Interval Common */

.wp_stream_screen .date-interval .field-predefined {
Expand Down Expand Up @@ -325,6 +326,7 @@
content: '\f345';
}


/* Select2 Common */

.wp_stream_screen li.select2-searching {
Expand Down Expand Up @@ -384,6 +386,7 @@
-moz-filter: grayscale(100%); /* Firefox < 3.5 */
}


/* Exclude List Table */
.stream-exclude-list {
margin-top: 1em;
Expand Down Expand Up @@ -476,6 +479,7 @@
}
}


/* User Profile */

.wp-stream-feeds-key .spinner {
Expand Down
15 changes: 15 additions & 0 deletions ui/js/settings.js
Expand Up @@ -89,8 +89,12 @@ jQuery(function( $ ) {
};
},
allowClear: true,
multiple: true,
maximumSelectionSize: 1,
placeholder: $input_ip.data( 'placeholder' )
});
}).on( 'change', function() {
$( this ).prev( '.select2-container' ).find( 'input.select2-input' ).blur();
});

$( '.stream-exclude-list tr:not(.hidden) input[type=hidden].select2-select.author_or_role' ).each(function( k, el ) {
Expand Down Expand Up @@ -191,6 +195,17 @@ jQuery(function( $ ) {
});
});

$( 'ul.select2-choices, ul.select2-choices li, input.select2-input', '.stream-exclude-list tr:not(.hidden) .ip_address' ).on( 'mousedown click focus', function() {
var $container = $( this ).closest( '.select2-container' ),
$input = $container.find( 'input.select2-input' ),
value = $container.select2( 'data' );

if ( value.length >= 1 ) {
$input.blur();
return false;
}
});

$( '.stream-exclude-list tr:not(.hidden) input[type=hidden].select2-select.context' ).on( 'change', function( val ) {
var $connector = $( this ).prevAll( ':input.connector' );

Expand Down

0 comments on commit 51c7033

Please sign in to comment.