Skip to content

Commit

Permalink
Merge pull request #3 from Dogfalo/master
Browse files Browse the repository at this point in the history
Sync
  • Loading branch information
aschoenebeck authored May 17, 2017
2 parents c3c9d74 + 7c2527c commit 9b2aaa2
Show file tree
Hide file tree
Showing 17 changed files with 91 additions and 505 deletions.
5 changes: 2 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,11 @@ bower_components
.grunt/
.versions

# Ignore .html files in root except SpecRunner
# Ignore .html files in root
*.html
!_SpecRunner.html
!fab-toolbar-demo.html

# Ignore compiled files
css/ghpages-materialize.css
bin/materialize.js
bin/materialize.css
bin/materialize.css
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
language: node_js
node_js:
- "0.12"
- "6.10"
before_install:
- npm install -g grunt-cli
git:
Expand Down
2 changes: 1 addition & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,7 @@ module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-notify');
grunt.loadNpmTasks('grunt-text-replace');
grunt.loadNpmTasks('grunt-banner');
grunt.loadNpmTasks('grunt-rename');
grunt.loadNpmTasks('grunt-rename-util');
grunt.loadNpmTasks('grunt-remove-logging');
grunt.loadNpmTasks('grunt-browser-sync');
grunt.loadNpmTasks('grunt-contrib-jasmine');
Expand Down
63 changes: 0 additions & 63 deletions _SpecRunner.html

This file was deleted.

12 changes: 11 additions & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,17 @@
],
"main": [
"bin/materialize.css",
"bin/materialize.js"
"bin/materialize.js",
"fonts/roboto/Roboto-Bold.woff",
"fonts/roboto/Roboto-Bold.woff2",
"fonts/roboto/Roboto-Light.woff"
"fonts/roboto/Roboto-Light.woff2",
"fonts/roboto/Roboto-Medium.woff",
"fonts/roboto/Roboto-Medium.woff2",
"fonts/roboto/Roboto-Regular.woff",
"fonts/roboto/Roboto-Regular.woff2",
"fonts/roboto/Roboto-Thin.woff",
"fonts/roboto/Roboto-Thin.woff2"
],
"ignore": [
"jade/",
Expand Down
4 changes: 2 additions & 2 deletions jade/about/about_content.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<div class="row">
<div class="col s12 m9">
<h1 class="header center-on-small-only">About</h1>
<h4 class ="light red-text text-lighten-4 center-on-small-only">Learn about the Material Design and our Project Team.</h4>
<h4 class ="light red-text text-lighten-4 center-on-small-only">Learn about Material Design and our Project Team.</h4>
</div>
<div class="col s12 m3">
<div class="buysellads-header center-on-small-only">
Expand Down Expand Up @@ -129,4 +129,4 @@ <h4>Kevin Louie</h4>
</div>

</div>
</div> <!-- End Container -->
</div> <!-- End Container -->
19 changes: 17 additions & 2 deletions jade/page-contents/scrollspy_content.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ <h4>jQuery Plugin Options</h4>
<table class="highlight">
<thead>
<tr>
<th>Option Name</th>
<th style="min-width: 150px;">Option Name</th>
<th>Description</th>
</tr>
</thead>
Expand All @@ -63,6 +63,22 @@ <h4>jQuery Plugin Options</h4>
<td>scrollOffset</td>
<td>Offset for centering element when scrolled to. Default: 200</td>
</tr>
<tr>
<td>activeClass</td>
<td>Class name to be added to the active link. Default: active</td>
</tr>
<tr>
<td>getActiveElement</td>
<td>
Function that returns a selector to add <code class="language-markup inline">activeClass</code> to. The parameter is the section id.

Default: <pre><code class="language-javascript">
function(id) {
return 'a[href=#' + id + ']';
}
</code></pre>
</td>
</tr>
</tbody>
</table>
</div>
Expand All @@ -89,4 +105,3 @@ <h4>jQuery Plugin Options</h4>

</div>
</div>

16 changes: 13 additions & 3 deletions js/cards.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,34 @@

$(document).on('click.card', '.card', function (e) {
if ($(this).find('> .card-reveal').length) {
var $card = $(e.target).closest('.card');
if ($card.data('initialOverflow') === undefined) {
$card.data(
'initialOverflow',
$card.css('overflow') === undefined ? '' : $card.css('overflow')
);
}
if ($(e.target).is($('.card-reveal .card-title')) || $(e.target).is($('.card-reveal .card-title i'))) {
// Make Reveal animate down and display none
$(this).find('.card-reveal').velocity(
{translateY: 0}, {
duration: 225,
queue: false,
easing: 'easeInOutQuad',
complete: function() { $(this).css({ display: 'none'}); }
complete: function() {
$(this).css({ display: 'none'});
$card.css('overflow', $card.data('initialOverflow'));
}
}
);
}
else if ($(e.target).is($('.card .activator')) ||
$(e.target).is($('.card .activator i')) ) {
$(e.target).closest('.card').css('overflow', 'hidden');
$card.css('overflow', 'hidden');
$(this).find('.card-reveal').css({ display: 'block'}).velocity("stop", false).velocity({translateY: '-100%'}, {duration: 300, queue: false, easing: 'easeInOutQuad'});
}
}
});

});
}( jQuery ));
}( jQuery ));
8 changes: 4 additions & 4 deletions js/chips.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@
$currChips.removeClass('focus');

// Remove active if empty
if (!$currChips.data('chips').length) {
if ($currChips.data('chips') === undefined || !$currChips.data('chips').length) {
$currChips.siblings('label').removeClass('active');
}
$currChips.siblings('.prefix').removeClass('active');
Expand Down Expand Up @@ -208,7 +208,7 @@
if (label.length) {
label.attr('for', chipId);

if ($chips.data('chips').length) {
if ($chips.data('chips')!== undefined && $chips.data('chips').length) {
label.addClass('active');
}
}
Expand Down Expand Up @@ -243,10 +243,10 @@
};

this.setPlaceholder = function($chips) {
if ($chips.data('chips').length && curr_options.placeholder) {
if ($chips.data('chips') !== undefined && $chips.data('chips').length && curr_options.placeholder) {
$chips.find('input').prop('placeholder', curr_options.placeholder);

} else if (!$chips.data('chips').length && curr_options.secondaryPlaceholder) {
} else if (($chips.data('chips') === undefined || !$chips.data('chips').length) && curr_options.secondaryPlaceholder) {
$chips.find('input').prop('placeholder', curr_options.secondaryPlaceholder);
}
};
Expand Down
15 changes: 10 additions & 5 deletions js/scrollspy.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,17 @@
offsetRight : number -> offset from right. Default: 0
offsetBottom : number -> offset from bottom. Default: 0
offsetLeft : number -> offset from left. Default: 0
activeClass : string -> Class name to be added to the active link. Default: active
* @returns {jQuery}
*/
$.scrollSpy = function(selector, options) {
var defaults = {
throttle: 100,
scrollOffset: 200 // offset - 200 allows elements near bottom of page to scroll
scrollOffset: 200, // offset - 200 allows elements near bottom of page to scroll
activeClass: 'active',
getActiveElement: function(id) {
return 'a[href=#' + id + ']';
}
};
options = $.extend(defaults, options);

Expand Down Expand Up @@ -167,7 +172,7 @@
var $this = $(this);

if (visible[0]) {
$('a[href="#' + visible[0].attr('id') + '"]').removeClass('active');
$(options.getActiveElement(visible[0].attr('id'))).removeClass(options.activeClass);
if ($this.data('scrollSpy:id') < visible[0].data('scrollSpy:id')) {
visible.unshift($(this));
}
Expand All @@ -180,21 +185,21 @@
}


$('a[href="#' + visible[0].attr('id') + '"]').addClass('active');
$(options.getActiveElement(visible[0].attr('id'))).addClass(options.activeClass);
});
selector.on('scrollSpy:exit', function() {
visible = $.grep(visible, function(value) {
return value.height() != 0;
});

if (visible[0]) {
$('a[href="#' + visible[0].attr('id') + '"]').removeClass('active');
$(options.getActiveElement(visible[0].attr('id'))).removeClass(options.activeClass);
var $this = $(this);
visible = $.grep(visible, function(value) {
return value.attr('id') != $this.attr('id');
});
if (visible[0]) { // Check if empty
$('a[href="#' + visible[0].attr('id') + '"]').addClass('active');
$(options.getActiveElement(visible[0].attr('id'))).addClass(options.activeClass);
}
}
});
Expand Down
2 changes: 1 addition & 1 deletion js/waves.js
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@
if (!(target instanceof SVGElement) && target.className.indexOf('waves-effect') !== -1) {
element = target;
break;
} else if (target.classList.contains('waves-effect')) {
} else if (target.className.indexOf('waves-effect') !== -1) {
element = target;
break;
}
Expand Down
41 changes: 20 additions & 21 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,37 +11,36 @@
"url": "git://github.com/Dogfalo/materialize.git"
},
"dependencies": {
"hammerjs": "^2.0.4",
"hammerjs": "^2.0.8",
"jquery": "^2.1.4",
"node-archiver": "^0.3.0"
},
"engine": "node >= 0.10",
"engine": "node >= 6.10.0",
"devDependencies": {
"autoprefixer": "^6.1.0",
"grunt": "^0.4.5",
"autoprefixer": "^6.7.7",
"grunt": "^1.0.1",
"grunt-banner": "^0.6.0",
"grunt-browser-sync": "^2.2.0",
"grunt-concurrent": "^2.0.0",
"grunt-contrib-clean": "^0.7.0",
"grunt-contrib-compress": "^0.14.0",
"grunt-contrib-concat": "^0.5.0",
"grunt-contrib-copy": "^0.8.0",
"grunt-contrib-cssmin": "^0.14.0",
"grunt-contrib-jade": "^0.15.0",
"grunt-contrib-jasmine": "^0.9.2",
"grunt-contrib-uglify": "^0.11.0",
"grunt-contrib-watch": "^0.6.0",
"grunt-notify": "^0.4.1",
"grunt-postcss": "^0.7.1",
"grunt-concurrent": "^2.3.1",
"grunt-contrib-clean": "^1.1.0",
"grunt-contrib-compress": "^1.4.1",
"grunt-contrib-concat": "^1.0.1",
"grunt-contrib-copy": "^1.0.0",
"grunt-contrib-jade": "^1.0.0",
"grunt-contrib-jasmine": "^1.1.0",
"grunt-contrib-uglify": "^2.3.0",
"grunt-contrib-watch": "^1.0.0",
"grunt-notify": "^0.4.5",
"grunt-postcss": "^0.8.0",
"grunt-remove-logging": "^0.2.0",
"grunt-rename": "^0.1.4",
"grunt-sass": "^1.1.0",
"grunt-rename-util": "^1.0.0",
"grunt-sass": "^2.0.0",
"grunt-text-replace": "^0.4.0",
"jasmine": "^2.3.2",
"jasmine": "^2.6.0",
"jasmine-jquery": "^2.1.1",
"jquery": "^2.1.4",
"node-sass": "^3.4.2",
"phantomjs": "^1.9.18"
"node-sass": "^4.5.2",
"phantomjs-prebuilt": "^2.1.14"
},
"scripts": {
"test": "grunt travis --verbose"
Expand Down
Loading

0 comments on commit 9b2aaa2

Please sign in to comment.