mirror of https://github.com/akveo/blur-admin
parent
76110dd782
commit
e1958b5e86
@ -0,0 +1,26 @@
|
||||
(function(blurAdminApp) {
|
||||
'use strict';
|
||||
|
||||
blurAdminApp.directive('trackWidth', [function () {
|
||||
return {
|
||||
scope: {
|
||||
trackWidth: '=',
|
||||
minWidth: '=',
|
||||
},
|
||||
link: function (scope, element) {
|
||||
scope.trackWidth = $(element).width() < scope.minWidth;
|
||||
scope.prevTrackWidth = scope.trackWidth;
|
||||
|
||||
$(window).resize(function() {
|
||||
var trackWidth = $(element).width() < scope.minWidth;
|
||||
if (trackWidth !== scope.prevTrackWidth) {
|
||||
scope.$apply(function() {
|
||||
scope.trackWidth = trackWidth;
|
||||
});
|
||||
}
|
||||
scope.prevTrackWidth = trackWidth;
|
||||
});
|
||||
}
|
||||
};
|
||||
}]);
|
||||
})(blurAdminApp);
|
@ -1,19 +1,27 @@
|
||||
<div class="feed-message" ng-repeat="message in feed" ng-class="{'left': $index%2==0, 'right': $index%2==1}">
|
||||
<img ng-src="img/{{ ::message.author }}.png">
|
||||
<div class="text-block" ng-class="message.type">
|
||||
<div class="message-header">
|
||||
<span class="author">{{ ::message.author }}</span>{{ ::message.header }}
|
||||
</div>
|
||||
<div class="message-content">
|
||||
{{::message.text}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="message-time">
|
||||
<div class="post-time">
|
||||
{{::message.time}}
|
||||
</div>
|
||||
<div class="ago-time">
|
||||
{{::message.ago}}
|
||||
|
||||
<div class="feed-messages-container" track-width="smallContainerWidth" min-width="360">
|
||||
<div class="feed-message" ng-repeat="message in feed" ng-class="{'left': $index%2==0, 'right': $index%2==1}">
|
||||
<img ng-src="img/{{ ::message.author }}.png">
|
||||
<div class="text-block" ng-class="{'small-message': smallContainerWidth && message.type != 'text-message', '{{::message.type}}': true}">
|
||||
<div class="message-header">
|
||||
<span class="author">{{ ::message.author }}</span>{{ ::message.header }}
|
||||
</div>
|
||||
<div class="message-content">
|
||||
{{::message.text}}
|
||||
</div>
|
||||
<div class="preview" ng-if="message.preview">
|
||||
<a href="{{::message.link}}" target="_blank">
|
||||
<img ng-src="img/{{ ::message.preview }}.png">
|
||||
</a>
|
||||
</div>
|
||||
<div class="message-time">
|
||||
<div class="post-time">
|
||||
{{::message.time}}
|
||||
</div>
|
||||
<div class="ago-time">
|
||||
{{::message.ago}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
After Width: | Height: | Size: 67 KiB |
After Width: | Height: | Size: 736 KiB |
After Width: | Height: | Size: 287 KiB |
Loading…
Reference in new issue