Fix popup positioning and make sure popups always open properly

(closes #24)
This commit is contained in:
Piotr Sarnacki 2012-10-16 19:36:32 +02:00
parent 5c8035b7a8
commit 0bb3eff03b
8 changed files with 1617 additions and 1616 deletions

View File

@ -8,7 +8,7 @@
<table id="allowed_failure_jobs" class="list"> <table id="allowed_failure_jobs" class="list">
<caption> <caption>
{{t jobs.allowed_failures}} {{t jobs.allowed_failures}}
<a title="What's this?" class="help" name="help-allowed_failures" {{action popup target="view"}}></a> <a title="What's this?" class="help open-popup" name="help-allowed_failures" {{action popup target="view"}}></a>
</caption> </caption>
{{/if}} {{/if}}
<thead> <thead>

View File

@ -2,7 +2,7 @@
<a href="#" {{action menu target="view"}}></a> <a href="#" {{action menu target="view"}}></a>
<ul class="menu"> <ul class="menu">
<li> <li>
<a href="#" name="status-images" {{action statusImages target="view"}}>Status Images</a> <a href="#" name="status-images" class="open-popup" {{action statusImages target="view"}}>Status Images</a>
</li> </li>
{{#if view.canPush}} {{#if view.canPush}}
<li> <li>

View File

@ -3,6 +3,8 @@
templateName: 'application' templateName: 'application'
classNames: ['application'] classNames: ['application']
popup: (event) ->
console.log event
localeDidChange: (-> localeDidChange: (->
if locale = Travis.app.get('auth.user.locale') if locale = Travis.app.get('auth.user.locale')
Travis.setLocale(locale) Travis.setLocale(locale)
@ -13,8 +15,9 @@
# TODO: this solves the case of closing menus and popups, # TODO: this solves the case of closing menus and popups,
# but I would like to rewrite it later, not sure how # but I would like to rewrite it later, not sure how
# yet, but this does not seem optimal # yet, but this does not seem optimal
if ! $(event.target).parents().andSelf().hasClass('popup') targetAndParents = $(event.target).parents().andSelf()
if ! ( targetAndParents.hasClass('open-popup') || targetAndParents.hasClass('popup') )
@popupCloseAll() @popupCloseAll()
if ! $(event.target).parents().andSelf().hasClass('menu') if ! targetAndParents.hasClass('menu')
$('.menu').removeClass('display') $('.menu').removeClass('display')

View File

@ -5,7 +5,7 @@
@mixin popup @mixin popup
display: none display: none
position: absolute position: fixed
z-index: 100 z-index: 100
background-color: #fff background-color: #fff
border: 10px solid rgba(0, 0, 0, .5) border: 10px solid rgba(0, 0, 0, .5)

View File

@ -13,7 +13,7 @@
top: 50% top: 50%
left: 50% left: 50%
width: 400px width: 400px
margin: -230px 0 0 -200px margin: -200px 0 0 -200px
padding: 20px padding: 20px
@include popup @include popup
@ -43,10 +43,9 @@
#status-images #status-images
display: none display: none
position: absolute
width: 600px width: 600px
height: 190px height: 190px
margin: -145px 0 0 -300px margin: -95px 0 0 -300px
p p
margin: 10px 0 margin: 10px 0

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff