Skip to content

Commit

Permalink
Remove toggle switches 1730 (#1731)
Browse files Browse the repository at this point in the history
* initial change to use input group addons

* fixed styling

* made white background for tracklist
  • Loading branch information
nathandunn committed Aug 17, 2017
1 parent 8aa1bac commit 4c1a65f
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 41 deletions.
23 changes: 0 additions & 23 deletions grails-app/assets/stylesheets/annotator.css
Original file line number Diff line number Diff line change
Expand Up @@ -123,27 +123,4 @@ h1 {
/*width: 100px;*/
}

.track-header {
display: inline;
cursor: pointer;
font-size: medium;
}

.track-link {
display: inline !important;
cursor: pointer;
font-size: small;
margin-left: 5px;
padding-left: 5px;
}

.track-link:hover {
display: inline !important;
color: blue;
text-decoration: underline;
}

.track-slider {
margin-right: 5px;
padding-right: 5px;
}
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ class PreferenceService {
}

UserOrganismPreference getCurrentOrganismPreferenceInDB(String token) {
getCurrentOrganismPreferenceInDB(permissionService.getCurrentUser(), null, token)
getCurrentOrganismPreferenceInDB(permissionService.currentUser, null, token)
}

/**
Expand Down
39 changes: 22 additions & 17 deletions src/gwt/org/bbop/apollo/gwt/client/TrackPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
import org.gwtbootstrap3.client.ui.constants.Toggle;
import org.gwtbootstrap3.extras.bootbox.client.Bootbox;
import org.gwtbootstrap3.extras.toggleswitch.client.ui.ToggleSwitch;
import org.gwtbootstrap3.extras.toggleswitch.client.ui.base.constants.SizeType;

import java.util.ArrayList;
import java.util.List;
Expand Down Expand Up @@ -207,21 +206,23 @@ public TrackBodyPanel(TrackInfo trackInfo) {
}

private void decorate() {
HTML label = new HTML(trackInfo.getName());
label.addStyleName("track-link");
final ToggleSwitch selected = new ToggleSwitch();

InputGroup inputGroup = new InputGroup();
addStyleName("track-entry");

final CheckBoxButton selected = new CheckBoxButton();
selected.setValue(trackInfo.getVisible());
selected.setSize(SizeType.MINI);
selected.setAnimate(false);
selected.setOffText("Show");
selected.setOnText("Hide");
selected.addStyleName("track-slider");
setPaddingTop(2);
setPaddingBottom(2);

add(selected);
add(label);
setWidth("100%");

InputGroupButton inputGroupButton = new InputGroupButton();
inputGroupButton.add(selected);
inputGroup.add(inputGroupButton);

InputGroupAddon label = new InputGroupAddon();
label.addStyleName("text-left");
label.setText(trackInfo.getName());
inputGroup.add(label);

add(inputGroup);

selected.addValueChangeHandler(new ValueChangeHandler<Boolean>() {
@Override
Expand All @@ -237,12 +238,16 @@ public void onValueChange(ValueChangeEvent<Boolean> event) {
MainPanel.getInstance().postMessage("handleTrackVisibility", jsonObject);
}
});
label.addClickHandler(new ClickHandler() {

label.addStyleName("track-link");
label.setWidth("100%");

label.addDomHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
MainPanel.getTrackPanel().setTrackInfo(trackInfo);
}
});
}, ClickEvent.getType());
}
}

Expand Down
37 changes: 37 additions & 0 deletions src/gwt/org/bbop/apollo/gwt/public/theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,41 @@
/*rotation: 90deg;*/
/*background-color: black;*/
/*color: yellowgreen;*/
}

.track-link {
width: 5px;
/*display: inline !important;*/
/*cursor: pointer;*/
/*font-size: small;*/
/*margin-left: 5px;*/
/*padding-left: 5px;*/
}

.track-link:hover {
/*display: inline !important;*/
color: blue;
text-decoration: underline;
cursor: pointer;
}

.track-slider {
/*display: inline ;*/
/*margin-right: 5px;*/
/*padding-right: 5px;*/
}

.track-entry {
padding-top: 1px !important;
padding-bottom: 5px !important;
}
.track-header {
display: inline;
cursor: pointer;
font-size: medium;
}

.text-left {
text-align: left !important;
background-color: white !important;
}

0 comments on commit 4c1a65f

Please sign in to comment.