Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

Commit

Permalink
refactor(sticky): refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
rschmukler authored and ajoslin committed Oct 3, 2014
1 parent 43b54b3 commit 41d562b
Show file tree
Hide file tree
Showing 7 changed files with 298 additions and 259 deletions.
5 changes: 1 addition & 4 deletions src/components/content/_content.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
material-content {

display: block;
position: relative;
overflow: auto;
-webkit-overflow-scrolling: touch;

Expand All @@ -18,10 +19,6 @@ material-content {
&.material-content-padding {
padding: 8px;
}

&[scroll-shrink] {
position: relative;
}
}

@media (min-width: $layout-breakpoint-sm) {
Expand Down
5 changes: 3 additions & 2 deletions src/components/content/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,14 @@ angular.module('material.components.content', [
function materialContentDirective() {
return {
restrict: 'E',
controller: ['$element', ContentController],
controller: ['$scope', '$element', ContentController],
link: function($scope, $element, $attr) {
$scope.$broadcast('$materialContentLoaded', $element);
}
};

function ContentController($element) {
function ContentController($scope, $element) {
this.$scope = $scope;
this.$element = $element;
}
}
31 changes: 28 additions & 3 deletions src/components/sticky/_sticky.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,30 @@
.material-sticky-active {
top: 0px;
position: fixed;






.material-subheader {
position:relative;
}
.material-sticky-invisible {
opacity: 0;
}

.material-sticky-container {
position: absolute;
z-index: 2;
overflow: hidden;
pointer-events: none;

.material-sticky-clone {
top: 0;
left: 0;
right: 24px;
position: absolute;
@include transform(translate3d(0, 0, 0));
&:not(.material-sticky-active) {
@include transform(translate3d(-9999px, -9999px, 0));
}
}
}
Loading

0 comments on commit 41d562b

Please sign in to comment.