forked from openshift/origin
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Use flexbox for the template and image catalogs * Remove intermediate modal dialog and show template and image metadata directly in the card * Expand template catalog directly on initial create page * Show loading message for templates * Truncate long text descriptions Fixes openshift#2536 Fixes openshift#3116 Fixes openshift#3144 Fixes openshift#3323
- Loading branch information
Showing
19 changed files
with
468 additions
and
609 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
'use strict'; | ||
|
||
angular.module('openshiftConsole') | ||
// Truncates text to a length, adding a tooltip and an ellipsis if truncated. | ||
// Different than `text-overflow: ellipsis` because it allows for multiline text. | ||
.directive('truncateLongText', function() { | ||
return { | ||
restrict: 'E', | ||
scope: { | ||
content: '=', | ||
limit: '=', | ||
useWordBoundary: '=' | ||
}, | ||
template: '<span ng-attr-title="{{content}}">{{visibleContent}}<span ng-if="truncated">…</span></span>', | ||
link: function(scope, elem, attr) { | ||
scope.visibleContent = scope.content; | ||
scope.$watch('content', function(content) { | ||
if (!scope.limit || !content || content.length <= scope.limit) { | ||
scope.truncated = false; | ||
scope.visibleContent = content; | ||
return; | ||
} | ||
|
||
scope.truncated = true; | ||
scope.visibleContent = content.substring(0, scope.limit); | ||
if (scope.useWordBoundary !== false) { | ||
// Find the last word break, but don't look more than 10 characters back. | ||
// Make sure we show at least the first 5 characters. | ||
var startIndex = Math.max(4, scope.limit - 10); | ||
var lastSpace = scope.visibleContent.lastIndexOf(' ', startIndex); | ||
if (lastSpace !== -1) { | ||
scope.visibleContent = scope.visibleContent.substring(0, lastSpace); | ||
} | ||
} | ||
}); | ||
} | ||
}; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.