mirror of https://github.com/twbs/ratchet.git
connors
11 years ago
7 changed files with 1 additions and 183 deletions
@ -1,36 +0,0 @@
|
||||
/* ---------------------------------- |
||||
* ALERT v0.0.1 |
||||
* Licensed under The MIT License |
||||
* http://opensource.org/licenses/MIT
|
||||
* ---------------------------------- */ |
||||
|
||||
!function () { |
||||
var findAlerts = function (target) { |
||||
var i, alerts = document.querySelectorAll('a'); |
||||
for (; target && target !== document; target = target.parentNode) { |
||||
for (i = alerts.length; i--;) { if (alerts[i] === target) return target; } |
||||
} |
||||
}; |
||||
|
||||
var onAlertHidden = function () { |
||||
var alert = getAlert(event); |
||||
|
||||
alert.style.display = 'none'; |
||||
alert.removeEventListener('webkitTransitionEnd', onAlertHidden); |
||||
} |
||||
|
||||
var getAlert = function (event) { |
||||
var alertDismiss = findAlerts(event.target); |
||||
if (alertDismiss && alertDismiss.hash) return document.querySelector(alertDismiss.hash); |
||||
}; |
||||
|
||||
window.addEventListener('click', function (event) { |
||||
var alert = getAlert(event); |
||||
|
||||
if (alert) { |
||||
if (alert && alert.classList.contains('alert')) alert.classList.add('dismiss'); |
||||
alert.addEventListener('webkitTransitionEnd', onAlertHidden); |
||||
event.preventDefault(); |
||||
} |
||||
}); |
||||
}(); |
@ -1,52 +0,0 @@
|
||||
// |
||||
// Alerts |
||||
// -------------------------------------------------- |
||||
|
||||
.alert { |
||||
position: fixed; |
||||
right: 15px; |
||||
left: 15px; |
||||
bottom: $bar-tab-height + 15px; |
||||
padding: 15px; |
||||
color: #fff; |
||||
border-radius: 3px; |
||||
z-index: 10; |
||||
@include transition(opacity); |
||||
@include transition-duration(.2s); |
||||
@include transition-timing-function(linear); |
||||
|
||||
.close { |
||||
position: relative; |
||||
top: -2px; |
||||
float: right; |
||||
color: inherit; |
||||
cursor: pointer; |
||||
@include transition(opacity); |
||||
@include transition-duration(.2s); |
||||
@include transition-timing-function(linear); |
||||
|
||||
&:active { |
||||
opacity: .6; |
||||
} |
||||
} |
||||
|
||||
&.dismiss { |
||||
opacity: 0; |
||||
} |
||||
} |
||||
|
||||
// Positive alert (Default color is green) |
||||
.alert-positive { |
||||
background-color: transparentize($positive-color, .03); |
||||
} |
||||
|
||||
// Negative alert (Default color is red) |
||||
.alert-negative { |
||||
background-color: transparentize($negative-color, .03); |
||||
} |
||||
|
||||
// Inline alert |
||||
.alert-inline { |
||||
position: static; |
||||
margin: 15px; |
||||
} |
Loading…
Reference in new issue