Skip to content

Commit

Permalink
Fixes #16286 - Move multiselect from gem to npm
Browse files Browse the repository at this point in the history
  • Loading branch information
tbrisker authored and dLobatog committed Sep 23, 2016
1 parent 5284a31 commit 3f30919
Show file tree
Hide file tree
Showing 11 changed files with 41 additions and 121 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@ language: node_js
node_js:
- "node"
- "4" # Fedora
before_install:
npm install -g npm@'>=3.0.0'
script: ./script/travis_run_js_tests.sh
Binary file removed app/assets/images/switch.png
Binary file not shown.
1 change: 0 additions & 1 deletion app/assets/javascripts/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
//= require jquery.ui.spinner
//= require scoped_search
//= require bootstrap
//= require multi-select
//= require charts
//= require topbar
//= require two-pane
Expand Down
10 changes: 5 additions & 5 deletions app/assets/javascripts/jquery.multi-select.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,29 +29,29 @@ function multiSelectToolTips(){
var missing_ids = $.parseJSON(mismatches);
$.each(missing_ids, function(index,missing_id){
opt_id = sanitize(missing_id+'');
$(msid).find('li#'+opt_id+'-selectable').addClass('delete').tooltip({title: __("Select this since it belongs to a host"), placement: "left"});
$(msid).find('li#'+opt_id+'-selectable').addClass('delete').tooltip({container: 'body', title: __("Select this since it belongs to a host"), placement: "left"});
})
}
if (!(useds == null || descendants == 'useds')) {
var used_ids = $.parseJSON(useds);
$.each(used_ids, function(index,used_id){
opt_id = sanitize(used_id+'');
$(msid).find('li#'+opt_id+'-selection').addClass('used_by_hosts').tooltip({title: __("This is used by a host"), placement: "right"});
$(msid).find('li#'+opt_id+'-selection').addClass('used_by_hosts').tooltip({container: 'body', title: __("This is used by a host"), placement: "right"});
})
}
if (!(inheriteds == null || inheriteds == 'undefined')) {
var inherited_ids = $.parseJSON(inheriteds);
$.each(inherited_ids, function(index,inherited_id){
opt_id = sanitize(inherited_id+'');
$(msid).find('li#'+opt_id+'-selection').addClass('inherited').tooltip({title: __("This is inherited from parent"), placement: "right"});
$(msid).find('li#'+opt_id+'-selection').addClass('inherited').tooltip({container: 'body', title: __("This is inherited from parent"), placement: "right"});
})
}
if (!(descendants == null || descendants == 'undefined')) {
var descendant_ids = $.parseJSON(descendants);
$.each(descendant_ids, function(index,descendant_id){
opt_id = sanitize(descendant_id+'');
$(msid).find('li#'+opt_id+'-selection').addClass('descendants').tooltip({title: __("Parent is already selected"), placement: "right"});
$(msid).find('li#'+opt_id+'-selectable').addClass('descendants').tooltip({title: __("Parent is already selected"), placement: "left"});
$(msid).find('li#'+opt_id+'-selection').addClass('descendants').tooltip({container: 'body', title: __("Parent is already selected"), placement: "right"});
$(msid).find('li#'+opt_id+'-selectable').addClass('descendants').tooltip({container: 'body', title: __("Parent is already selected"), placement: "left"});
})
}
})
Expand Down
1 change: 0 additions & 1 deletion app/assets/stylesheets/application.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
@import "jquery.ui.spinner_custom";
@import "../../../vendor/assets/stylesheets/vendor";
@import "scoped_search";
@import "multi-select";
@import "patternfly-sprockets";
@import "patternfly";
@import "editable/bootstrap-editable";
Expand Down
30 changes: 30 additions & 0 deletions app/assets/stylesheets/multi-select-overrides.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
.ms-container{
width: 520px;

.ms-list{
border-radius: 0;
}

.ms-selectable li.ms-elem-selectable,
.ms-selection li.ms-elem-selection{
padding: 5px 10px;
font-size: 12px;
}

.ms-header{
padding: 4px 10px;
border: 1px solid #d1d1d1;
background-clip: padding-box;
background: linear-gradient(to bottom, #f9f9f9, #ededed);
.ms-filter{
width: 140px;
height: 20px;
display: inline;
}
}

.ms-select-all,.ms-select-all:hover,.ms-deselect-all,.ms-deselect-all:hover{
text-decoration: none;
margin-top: 3px !important;
}
}
1 change: 0 additions & 1 deletion bundler.d/assets.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
gem 'jquery-ui-rails', '< 5.0.0'
gem 'autoprefixer-rails', '~> 5.2'
gem 'patternfly-sass', '~> 2.7'
gem 'multi-select-rails', '~> 0.9'
gem 'gridster-rails', '~> 0.5'
gem 'gettext_i18n_rails_js', '~> 1.0'
gem 'execjs', '>= 1.4.0', '< 3.0'
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"jquery.cookie": "~1.4.1",
"jstz": "~1.0.7",
"lodash": "~4.15.0",
"multiselect": "~0.9.12",
"select2": "~3.5.2-browserify"
},
"scripts": {
Expand Down
113 changes: 0 additions & 113 deletions vendor/assets/stylesheets/multi-select.scss

This file was deleted.

1 change: 1 addition & 0 deletions webpack/assets/javascripts/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ require('expose?ipaddr!ipaddr.js');
require('jquery.cookie');
require('expose?JsDiff!diff');
require('./bundle_flot');
require('./bundle_multiselect');
require('./bundle_select2');
require('./bundle_datatables');
window.tfm = {
Expand Down
2 changes: 2 additions & 0 deletions webpack/assets/javascripts/bundle_multiselect.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
require('multiselect');
require('multiselect/css/multi-select.css');

0 comments on commit 3f30919

Please sign in to comment.