Skip to content

Commit

Permalink
Merge pull request #7 from netgen-layouts/datetime-picker-fix
Browse files Browse the repository at this point in the history
Fix styling and initialization for datetime picker in sidebar
  • Loading branch information
emodric authored Oct 17, 2023
2 parents 4173004 + 927173b commit bcd505f
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 3 deletions.
2 changes: 0 additions & 2 deletions app/scripts/models/blocks/block.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ module.exports = BmModel.extend({


remove_block_from_zone: function(){
console.log(this, arguments);
return this;
},

Expand Down Expand Up @@ -169,7 +168,6 @@ module.exports = BmModel.extend({
method: 'POST',
patch: true
}).done(function() {
console.log(this);
this.update_zone_blocks(previous_zone, attributes.zone_identifier);
this.zone().set('block_ids', zone_block_ids);
}.bind(this));
Expand Down
6 changes: 6 additions & 0 deletions app/scripts/views/sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ module.exports = Core.View.extend({
this.$toggle_panels_on_render();
this.$add_range_values();
this.remove_loader();

this.$el.find('.datetimepicker').each(function () {
var a = new Core.DateTimePicker({
el: $(this),
})
})
},

remove_loader: function(){
Expand Down
1 change: 1 addition & 0 deletions app/styles/_app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@
@import 'layout_type_modal';
@import 'specific';
@import 'modal';
@import 'datetime_picker'
50 changes: 50 additions & 0 deletions app/styles/_datetime_picker.scss
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,56 @@
.datetimepicker {
padding-right: 2rem;
position: relative;

.sidebar-panel & {
padding-right: 0;
margin-right: .25rem;

.datetime {
input[type='text'] {

#sidebar & {
padding-right: 2.125rem;

}
}

.input-icon {
transform: translateY(calc(-50% - .25rem));
padding-right: 0.25em;
}
}

.js-clear-input {
right: auto;
left: 100%;
margin-top: -1.25rem;

}

.bootstrap-datetimepicker-widget table {
thead tr:first-child th:hover {
background: #666666;
}

td {
&.day:hover,
span:hover {
background: #666666;
}
}
}

.dropdown-menu {
background-color: #4f4f4f;
color: white;

* {
color: white;
}
}
}

.input-group {
flex: 1;
}
Expand Down
5 changes: 4 additions & 1 deletion app/styles/_sidebar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@
padding: $gutter;
border-top: 1px solid $toolbarBorderColor;
color: #fff;
overflow-y: auto;
overflow-y: visible;
overflow-x: visible;


h1 {
font-size: 1.4em;
}
Expand Down

0 comments on commit bcd505f

Please sign in to comment.