Skip to content

Commit c54effc

Browse files
committed
v0.96.1
1 parent 8f738c9 commit c54effc

File tree

5 files changed

+125
-85
lines changed

5 files changed

+125
-85
lines changed

assets/README.md

100644100755
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
[![Gitter](https://badges.gitter.im/Join Chat.svg)](https://gitter.im/Dogfalo/materialize?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
55
Materialize, a CSS Framework based on material design
66

7-
### Current Version : v0.95.3
7+
### Current Version : v0.96.0
88

99
## Sass Requirements:
1010
- Ruby Sass 3.3+, LibSass 0.6+
@@ -17,7 +17,7 @@ Chrome 35+, Firefox 31+, Safari 7+, IE 10+
1717
- `npm install`
1818
- `grunt monitor`, this will compile .scss, .js., .jade files
1919
- Documentation
20-
- If you notice an error in the documentation. Please edit the corresponding .html page under jade/page-contents/.
20+
- If you notice an error in the documentation, please edit the corresponding .html page under jade/page-contents/.
2121
- Issues
2222
- If you have an issue please make sure you document the problems in depth. One line issues with no explanations will be closed.
2323
- Feature Requests
@@ -26,7 +26,7 @@ Chrome 35+, Firefox 31+, Safari 7+, IE 10+
2626
- Use this [codepen](http://codepen.io/Dogfalo/pen/xbzPQV) to illustrate your problem.
2727

2828
## Changelog
29-
- v0.96.0 (Upcoming)
29+
- v0.96.0 (April 1, 2015)
3030
- **Toasts, transitions, scrollfire added under Materialize namespace**
3131
- **Dropdown is now created as a child of its parent**
3232
- Collapsibles supports nesting

assets/css/materialize.css

Lines changed: 40 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* Materialize v0.96.0 (http://materializecss.com)
2+
* Materialize v0.96.1 (http://materializecss.com)
33
* Copyright 2014-2015 Materialize
44
* MIT License (https://raw.githubusercontent.com/Dogfalo/materialize/master/LICENSE)
55
*/
@@ -2102,17 +2102,6 @@ img.responsive-img, video.responsive-video {
21022102
transform: translate3d(0, 0, 0);
21032103
transform: translateX(-50%); }
21042104

2105-
@media only screen and (max-width : 600px) {
2106-
.parallax-container {
2107-
height: auto; }
2108-
.parallax-container .parallax {
2109-
position: relative; }
2110-
.parallax-container .parallax img {
2111-
position: relative;
2112-
min-height: 0;
2113-
min-width: 0;
2114-
width: 100%; } }
2115-
21162105
.pin-top, .pin-bottom {
21172106
position: relative; }
21182107

@@ -2363,6 +2352,8 @@ span.badge {
23632352
padding-top: 30px;
23642353
height: 0;
23652354
overflow: hidden; }
2355+
.video-container.no-controls {
2356+
padding-top: 0; }
23662357
.video-container iframe, .video-container object, .video-container embed {
23672358
position: absolute;
23682359
top: 0;
@@ -5689,9 +5680,6 @@ button.btn-floating {
56895680
.btn-large i {
56905681
font-size: 1.6rem; }
56915682

5692-
.dropdown-button {
5693-
position: relative; }
5694-
56955683
.dropdown-content {
56965684
background-color: #FFFFFF;
56975685
margin: 0;
@@ -6114,6 +6102,29 @@ input[type=text], input[type=password], input[type=email], input[type=url], inpu
61146102
width: 80%;
61156103
width: calc(100% - 3rem); } }
61166104

6105+
.input-field input[type=search] {
6106+
display: block;
6107+
line-height: inherit;
6108+
padding-left: 4rem;
6109+
width: calc(100% - 4rem); }
6110+
.input-field input[type=search]:focus {
6111+
background-color: #FFF;
6112+
border: 0;
6113+
box-shadow: none;
6114+
color: #444; }
6115+
.input-field input[type=search]:focus + label i, .input-field input[type=search]:focus ~ .mdi-navigation-close {
6116+
color: #444; }
6117+
.input-field input[type=search] + label {
6118+
left: 1rem; }
6119+
.input-field input[type=search] ~ .mdi-navigation-close {
6120+
position: absolute;
6121+
top: 0;
6122+
right: 1rem;
6123+
color: transparent;
6124+
cursor: pointer;
6125+
font-size: 2rem;
6126+
transition: .3s color; }
6127+
61176128
textarea {
61186129
width: 100%;
61196130
height: 3rem;
@@ -6471,8 +6482,7 @@ input[type=checkbox]:not(:disabled) ~ .lever:active:after {
64716482
position: absolute; }
64726483

64736484
.select-wrapper {
6474-
position: relative;
6475-
margin-top: 15px; }
6485+
position: relative; }
64766486
.select-wrapper input.select-dropdown {
64776487
position: relative;
64786488
cursor: pointer;
@@ -6495,6 +6505,10 @@ input[type=checkbox]:not(:disabled) ~ .lever:active:after {
64956505
font-size: 23px; }
64966506
.select-wrapper .mdi-navigation-arrow-drop-down.disabled {
64976507
color: rgba(0, 0, 0, 0.26); }
6508+
.select-wrapper + label {
6509+
position: absolute;
6510+
top: -14px;
6511+
font-size: 0.8rem; }
64986512

64996513
select {
65006514
display: none; }
@@ -6507,15 +6521,21 @@ select:disabled {
65076521

65086522
.select-wrapper input.select-dropdown:disabled {
65096523
color: rgba(0, 0, 0, 0.3);
6524+
cursor: default;
6525+
-webkit-user-select: none;
6526+
/* webkit (safari, chrome) browsers */
6527+
-moz-user-select: none;
6528+
/* mozilla browsers */
6529+
-ms-user-select: none;
6530+
/* IE10+ */
65106531
border-bottom: 1px solid rgba(0, 0, 0, 0.3); }
65116532

65126533
.select-wrapper i {
65136534
color: rgba(0, 0, 0, 0.3); }
65146535

65156536
.select-dropdown li.disabled {
6516-
color: rgba(0, 0, 0, 0.3); }
6517-
.select-dropdown li.disabled:hover {
6518-
background-color: transparent; }
6537+
color: rgba(0, 0, 0, 0.3);
6538+
background-color: transparent; }
65196539

65206540
/*********************
65216541
File Input

assets/css/materialize.min.css

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/js/materialize.js

Lines changed: 75 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* Materialize v0.96.0 (http://materializecss.com)
2+
* Materialize v0.96.1 (http://materializecss.com)
33
* Copyright 2014-2015 Materialize
44
* MIT License (https://raw.githubusercontent.com/Dogfalo/materialize/master/LICENSE)
55
*/
@@ -252,7 +252,7 @@ jQuery.extend( jQuery.easing,
252252
};
253253
})(Hammer.Manager.prototype.emit);
254254
}));
255-
;var Materialize = {};
255+
;Materialize = {};
256256

257257
// Unique ID
258258
Materialize.guid = (function() {
@@ -354,16 +354,44 @@ if ($) { Vel = $.Velocity } else { Vel = Velocity};
354354
}
355355
}
356356

357+
/**
358+
* Check if object is children of panel header
359+
* @param {Object} object Jquery object
360+
* @return {Boolean} true if it is children
361+
*/
362+
function isChildrenOfPanelHeader(object) {
363+
364+
var panelHeader = getPanelHeader(object);
365+
366+
return panelHeader.length > 0;
367+
}
368+
369+
/**
370+
* Get panel header from a children element
371+
* @param {Object} object Jquery object
372+
* @return {Object} panel header object
373+
*/
374+
function getPanelHeader(object) {
375+
376+
return object.closest('li > .collapsible-header');
377+
}
378+
357379
/***** End Helper Functions *****/
358380

359381

360382

361383
if (options.accordion || collapsible_type == "accordion" || collapsible_type == undefined) { // Handle Accordion
362384
// Add click handler to only direct collapsible header children
363-
$this.find('> li > .collapsible-header').on('click.collapse', function (e) {
364-
var header = $(e.target);
365-
header.toggleClass('active');
366-
accordionOpen(header);
385+
$panel_headers = $this.find('> li > .collapsible-header');
386+
$panel_headers.on('click.collapse', function (e) {
387+
var element = $(e.target);
388+
389+
if (isChildrenOfPanelHeader(element)) {
390+
element = getPanelHeader(element);
391+
}
392+
393+
element.toggleClass('active');
394+
accordionOpen(element);
367395
});
368396
// Open first active
369397
accordionOpen($panel_headers.filter('.active').first());
@@ -372,9 +400,12 @@ if ($) { Vel = $.Velocity } else { Vel = Velocity};
372400
$panel_headers.each(function () {
373401
// Add click handler to only direct collapsible header children
374402
$(this).on('click.collapse', function (e) {
375-
var header = $(e.target);
376-
header.toggleClass('active');
377-
expandableOpen(header);
403+
var element = $(e.target);
404+
if (isChildrenOfPanelHeader(element)) {
405+
element = getPanelHeader(element);
406+
}
407+
element.toggleClass('active');
408+
expandableOpen(element);
378409
});
379410
// Open any bodies that have the active class
380411
if ($(this).hasClass('active')) {
@@ -434,15 +465,7 @@ if ($) { Vel = $.Velocity } else { Vel = Velocity};
434465
updateOptions();
435466

436467
// Attach dropdown to its activator
437-
if (origin.hasClass('select-dropdown')) {
438-
origin.after(activates)
439-
}
440-
else {
441-
origin.append(activates);
442-
}
443-
444-
445-
468+
origin.after(activates);
446469

447470
/*
448471
Helper function to position and resize dropdown.
@@ -452,6 +475,9 @@ if ($) { Vel = $.Velocity } else { Vel = Velocity};
452475
// Check html data attributes
453476
updateOptions();
454477

478+
// Set Dropdown state
479+
activates.addClass('active');
480+
455481
// Constrain width
456482
if (options.constrain_width == true) {
457483
activates.css('width', origin.outerWidth());
@@ -463,7 +489,6 @@ if ($) { Vel = $.Velocity } else { Vel = Velocity};
463489

464490
// Handle edge alignment
465491
var offsetLeft = origin.offset().left;
466-
467492
var width_difference = 0;
468493
var gutter_spacing = options.gutter;
469494

@@ -472,23 +497,15 @@ if ($) { Vel = $.Velocity } else { Vel = Velocity};
472497
width_difference = origin.innerWidth() - activates.innerWidth();
473498
gutter_spacing = gutter_spacing * -1;
474499
}
475-
// If fixed placement
476-
if (Materialize.elementOrParentIsFixed(origin[0])) {
477-
activates.css({
478-
top: 0 + offset,
479-
left: 0 + width_difference + gutter_spacing
480-
});
481-
}
482-
// If relative placement
483-
else {
484500

485-
activates.css({
486-
position: 'absolute',
487-
top: 0 + offset,
488-
left: 0 + width_difference + gutter_spacing
489-
});
501+
// Position dropdown
502+
activates.css({
503+
position: 'absolute',
504+
top: origin.position().top + offset,
505+
left: origin.position().left + width_difference + gutter_spacing
506+
});
507+
490508

491-
}
492509

493510
// Show dropdown
494511
activates.stop(true, true).css('opacity', 0)
@@ -501,59 +518,62 @@ if ($) { Vel = $.Velocity } else { Vel = Velocity};
501518
}
502519
})
503520
.animate( {opacity: 1}, {queue: false, duration: options.inDuration, easing: 'easeOutSine'});
504-
505-
506521
}
507522

508-
509523
function hideDropdown() {
510524
activates.fadeOut(options.outDuration);
525+
activates.removeClass('active');
511526
}
512527

513-
activates.on('hover', function(e) {
514-
e.stopPropagation();
515-
});
516-
517528
// Hover
518529
if (options.hover) {
530+
var open = false;
519531
origin.unbind('click.' + origin.attr('id'));
520532
// Hover handler to show dropdown
521533
origin.on('mouseenter', function(e){ // Mouse over
522-
placeDropdown();
534+
if (open === false) {
535+
placeDropdown();
536+
open = true
537+
}
538+
});
539+
origin.on('mouseleave', function(e){
540+
// If hover on origin then to something other than dropdown content, then close
541+
if(!$(e.toElement).closest('.dropdown-content').is(activates)) {
542+
activates.stop(true, true);
543+
hideDropdown();
544+
open = false;
545+
}
523546
});
524547

525-
origin.on('mouseleave', function(e){ // Mouse out
526-
activates.stop(true, true);
527-
hideDropdown();
548+
activates.on('mouseleave', function(e){ // Mouse out
549+
if(!$(e.toElement).closest('.dropdown-button').is(origin)) {
550+
activates.stop(true, true);
551+
hideDropdown();
552+
open = false;
553+
}
528554
});
529555

530556
// Click
531557
} else {
532-
var open = false;
533558

534559
// Click handler to show dropdown
535560
origin.unbind('click.' + origin.attr('id'));
536561
origin.bind('click.'+origin.attr('id'), function(e){
537-
// Handles case for select plugin
538-
if (origin.hasClass('select-dropdown')) {
539-
return false;
540-
}
562+
541563
if ( origin[0] == e.currentTarget && ($(e.target).closest('.dropdown-content').length === 0) ) {
542564
e.preventDefault(); // Prevents button click from moving window
543565
placeDropdown();
544-
open = true;
545566

546567
}
547568
// If origin is clicked and menu is open, close menu
548569
else {
549-
if (open === true) {
570+
if (origin.hasClass('active')) {
550571
hideDropdown();
551572
$(document).unbind('click.' + activates.attr('id'));
552-
open = false;
553573
}
554574
}
555575
// If menu open, add click close handler to document
556-
if (open === true) {
576+
if (activates.hasClass('active')) {
557577
$(document).bind('click.'+ activates.attr('id'), function (e) {
558578
if (!activates.is(e.target) && !origin.is(e.target) && (!origin.find(e.target).length > 0) ) {
559579
hideDropdown();
@@ -2295,7 +2315,7 @@ $(document).ready(function(){
22952315

22962316
// offset - 200 allows elements near bottom of page to scroll
22972317

2298-
$('html, body').animate({ scrollTop: offset - 200 }, {duration: 400, easing: 'easeOutCubic'});
2318+
$('html, body').animate({ scrollTop: offset - 200 }, {duration: 400, queue: false, easing: 'easeOutCubic'});
22992319

23002320
});
23012321
});

assets/js/materialize.min.js

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)