Skip to content
This repository was archived by the owner on May 16, 2019. It is now read-only.

Commit 3075147

Browse files
committed
final tweaks to page nav server menu
1 parent 2919e59 commit 3075147

File tree

3 files changed

+44
-5
lines changed

3 files changed

+44
-5
lines changed

css/obBase.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4309,7 +4309,7 @@ input[type="checkbox"].fieldItem:checked + label .togLabelOff {
43094309
opacity: 0;
43104310
}
43114311
4312-
#ov1 .server-config-form:not('.no-transition') {
4312+
#ov1 .server-config-form:not(.no-transition) {
43134313
transition: top 250ms;
43144314
}
43154315

js/views/pageNavVw.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,7 @@ module.exports = baseVw.extend({
295295
self.addressInput = self.$el.find('.js-navAddressBar');
296296
self.statusBar = self.$el.find('.js-navStatusBar');
297297
self.serverSubmenu = self.$('.js-serverSubmenu');
298+
self.serverSubmenuTrigger = self.$('.js-serverSubmenuTrigger');
298299

299300
//listen for address bar set events
300301
self.listenTo(window.obEventBus, "setAddressBar", function(options){
@@ -487,7 +488,17 @@ module.exports = baseVw.extend({
487488
}
488489
},
489490

490-
closeNav: function() {
491+
closeNav: function(e) {
492+
if (
493+
e &&
494+
(
495+
e.target === this.serverSubmenuTrigger[0] ||
496+
$(e.target).parents('.js-serverSubmenuTrigger').length
497+
)
498+
) {
499+
return;
500+
}
501+
491502
app.hideOverlay();
492503
self.$('.js-navProfileMenu').removeClass('popMenu-opened');
493504
clearTimeout(this.ServerSubmenuTimeout);

js/views/serverConnectModal.js

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ module.exports = BaseModal.extend({
5454
},
5555

5656
closeConfigForm: function() {
57+
var disp;
58+
5759
if (!this.$jsConfigFormWrap) return;
5860

5961
this.$jsConfigFormWrap.addClass('slide-out');
@@ -63,6 +65,22 @@ module.exports = BaseModal.extend({
6365
showNew: true
6466
});
6567

68+
setTimeout(() => {
69+
if (this.isOpen()) {
70+
// for some reason, when launching the modal and immediatally
71+
// opening the config, a subsequent close doesn't position it
72+
// properly unless we force a redraw (at least on Mac chrome).
73+
this.$jsConfigFormWrap.one('transitionend', () => {
74+
disp = this.$jsConfigFormWrap[0].style.display;
75+
this.$jsConfigFormWrap[0].style.display = 'none';
76+
77+
setTimeout(() => {
78+
this.$jsConfigFormWrap[0].style.display = disp;
79+
}, 100);
80+
});
81+
}
82+
}, 0);
83+
6684
return this;
6785
},
6886

@@ -98,9 +116,19 @@ module.exports = BaseModal.extend({
98116
this.connect(md);
99117
});
100118

101-
this.$jsConfigFormWrap.one('transitionend', () => {
102-
this.serverConfigFormVw.$('input[name="name"]').focus();
103-
}).removeClass(`slide-out ${!this.isOpen() ? 'no-transition' : ''}`);
119+
if (this.isOpen()) {
120+
this.$jsConfigFormWrap.one('transitionend', () => {
121+
this.serverConfigFormVw.$('input[name="name"]').focus();
122+
}).removeClass('slide-out');
123+
} else {
124+
this.$jsConfigFormWrap.addClass('no-transition')
125+
.removeClass('slide-out');
126+
127+
setTimeout(() => {
128+
this.serverConfigFormVw.$('input[name="name"]').focus();
129+
this.$jsConfigFormWrap.removeClass('no-transition');
130+
}, 0);
131+
}
104132

105133
return this;
106134
},

0 commit comments

Comments
 (0)