Skip to content

Commit

Permalink
Reverting fix for angular-ui#1221
Browse files Browse the repository at this point in the history
This fix caused cells to not account for the existence of a vertical
scrollbar which would cause a horizontal scrollbar to also appear. This
should fix angular-ui#3044.

Took from jjkovacs/ng-grid@2d2dcaa
  • Loading branch information
alleyj committed Jun 19, 2015
1 parent e895c79 commit 787a8fd
Show file tree
Hide file tree
Showing 6 changed files with 583 additions and 352 deletions.
292 changes: 191 additions & 101 deletions build/ng-grid.debug.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* ng-grid JavaScript Library
* Authors: https://github.com/angular-ui/ng-grid/blob/master/README.md
* License: MIT (http://www.opensource.org/licenses/mit-license.php)
* Compiled At: 04/08/2015 14:57
* Compiled At: 06/19/2015 10:12
***********************************************/
(function(window, $) {
'use strict';
Expand Down Expand Up @@ -346,12 +346,8 @@ angular.module('ngGrid.services').factory('$domUtilityService',['$utilityService
for (var i = 0; i < cols.length; i++) {
var col = cols[i];
if (col.visible !== false) {
var rightPad = 0;
if ((i === cols.length - 1) && (sumWidth + col.width < grid.elementDims.rootMaxW)) {
rightPad = grid.elementDims.rootMaxW - sumWidth - col.width;
}
css += "." + gridId + " .col" + i + " { width: " + (col.width + rightPad) + "px; left: " + sumWidth + "px; height: " + rowHeight + "px }" +
"." + gridId + " .colt" + i + " { width: " + (col.width + rightPad) + "px; }";
css += "." + gridId + " .col" + i + " { width: " + col.width + "px; left: " + sumWidth + "px; height: " + rowHeight + "px }" +
"." + gridId + " .colt" + i + " { width: " + col.width + "px; }";
sumWidth += col.width;
}
}
Expand Down Expand Up @@ -3830,22 +3826,34 @@ angular.module('ngGrid').run(['$templateCache', function($templateCache) {
'use strict';

$templateCache.put('aggregateTemplate.html',
"<div ng-click=\"row.toggleExpand()\" ng-style=\"rowStyle(row)\" class=\"ngAggregate\">\n" +
" <span class=\"ngAggregateText\">{{row.label CUSTOM_FILTERS}} ({{row.totalChildren()}} {{AggItemsLabel}})</span>\n" +
" <div class=\"{{row.aggClass()}}\"></div>\n" +
"</div>\n"
"<div ng-click=\"row.toggleExpand()\" ng-style=\"rowStyle(row)\" class=\"ngAggregate\">\r" +
"\n" +
" <span class=\"ngAggregateText\">{{row.label CUSTOM_FILTERS}} ({{row.totalChildren()}} {{AggItemsLabel}})</span>\r" +
"\n" +
" <div class=\"{{row.aggClass()}}\"></div>\r" +
"\n" +
"</div>\r" +
"\n"
);


$templateCache.put('cellEditTemplate.html',
"<div ng-cell-has-focus ng-dblclick=\"CELL_EDITABLE_CONDITION && editCell()\">\n" +
"\t<div ng-edit-cell-if=\"!(isFocused && CELL_EDITABLE_CONDITION)\">\t\n" +
"\t\tDISPLAY_CELL_TEMPLATE\n" +
"\t</div>\n" +
"\t<div ng-edit-cell-if=\"isFocused && CELL_EDITABLE_CONDITION\">\n" +
"\t\tEDITABLE_CELL_TEMPLATE\n" +
"\t</div>\n" +
"</div>\n"
"<div ng-cell-has-focus ng-dblclick=\"CELL_EDITABLE_CONDITION && editCell()\">\r" +
"\n" +
"\t<div ng-edit-cell-if=\"!(isFocused && CELL_EDITABLE_CONDITION)\">\t\r" +
"\n" +
"\t\tDISPLAY_CELL_TEMPLATE\r" +
"\n" +
"\t</div>\r" +
"\n" +
"\t<div ng-edit-cell-if=\"isFocused && CELL_EDITABLE_CONDITION\">\r" +
"\n" +
"\t\tEDITABLE_CELL_TEMPLATE\r" +
"\n" +
"\t</div>\r" +
"\n" +
"</div>\r" +
"\n"
);


Expand All @@ -3870,110 +3878,192 @@ angular.module('ngGrid').run(['$templateCache', function($templateCache) {


$templateCache.put('footerTemplate.html',
"<div ng-show=\"showFooter\" class=\"ngFooterPanel\" ng-class=\"{'ui-widget-content': jqueryUITheme, 'ui-corner-bottom': jqueryUITheme}\" ng-style=\"footerStyle()\">\n" +
" <div class=\"ngTotalSelectContainer\" >\n" +
" <div class=\"ngFooterTotalItems\" ng-class=\"{'ngNoMultiSelect': !multiSelect}\" >\n" +
" <span class=\"ngLabel\">{{i18n.ngTotalItemsLabel}} {{maxRows()}}</span><span ng-show=\"filterText.length > 0\" class=\"ngLabel\">({{i18n.ngShowingItemsLabel}} {{totalFilteredItemsLength()}})</span>\n" +
" </div>\n" +
" <div class=\"ngFooterSelectedItems\" ng-show=\"multiSelect\">\n" +
" <span class=\"ngLabel\">{{i18n.ngSelectedItemsLabel}} {{selectedItems.length}}</span>\n" +
" </div>\n" +
" </div>\n" +
" <div class=\"ngPagerContainer\" style=\"float: right; margin-top: 10px;\" ng-show=\"enablePaging\" ng-class=\"{'ngNoMultiSelect': !multiSelect}\">\n" +
" <div style=\"float:left; margin-right: 10px;\" class=\"ngRowCountPicker\">\n" +
" <span style=\"float: left; margin-top: 3px;\" class=\"ngLabel\">{{i18n.ngPageSizeLabel}}</span>\n" +
" <select style=\"float: left;height: 27px; width: 100px\" ng-model=\"pagingOptions.pageSize\" >\n" +
" <option ng-repeat=\"size in pagingOptions.pageSizes\">{{size}}</option>\n" +
" </select>\n" +
" </div>\n" +
" <div style=\"float:left; margin-right: 10px; line-height:25px;\" class=\"ngPagerControl\" style=\"float: left; min-width: 135px;\">\n" +
" <button type=\"button\" class=\"ngPagerButton\" ng-click=\"pageToFirst()\" ng-disabled=\"cantPageBackward()\" title=\"{{i18n.ngPagerFirstTitle}}\"><div class=\"ngPagerFirstTriangle\"><div class=\"ngPagerFirstBar\"></div></div></button>\n" +
" <button type=\"button\" class=\"ngPagerButton\" ng-click=\"pageBackward()\" ng-disabled=\"cantPageBackward()\" title=\"{{i18n.ngPagerPrevTitle}}\"><div class=\"ngPagerFirstTriangle ngPagerPrevTriangle\"></div></button>\n" +
" <input class=\"ngPagerCurrent\" min=\"1\" max=\"{{currentMaxPages}}\" type=\"number\" style=\"width:50px; height: 24px; margin-top: 1px; padding: 0 4px;\" ng-model=\"pagingOptions.currentPage\"/>\n" +
" <span class=\"ngGridMaxPagesNumber\" ng-show=\"maxPages() > 0\">/ {{maxPages()}}</span>\n" +
" <button type=\"button\" class=\"ngPagerButton\" ng-click=\"pageForward()\" ng-disabled=\"cantPageForward()\" title=\"{{i18n.ngPagerNextTitle}}\"><div class=\"ngPagerLastTriangle ngPagerNextTriangle\"></div></button>\n" +
" <button type=\"button\" class=\"ngPagerButton\" ng-click=\"pageToLast()\" ng-disabled=\"cantPageToLast()\" title=\"{{i18n.ngPagerLastTitle}}\"><div class=\"ngPagerLastTriangle\"><div class=\"ngPagerLastBar\"></div></div></button>\n" +
" </div>\n" +
" </div>\n" +
"</div>\n"
"<div ng-show=\"showFooter\" class=\"ngFooterPanel\" ng-class=\"{'ui-widget-content': jqueryUITheme, 'ui-corner-bottom': jqueryUITheme}\" ng-style=\"footerStyle()\">\r" +
"\n" +
" <div class=\"ngTotalSelectContainer\" >\r" +
"\n" +
" <div class=\"ngFooterTotalItems\" ng-class=\"{'ngNoMultiSelect': !multiSelect}\" >\r" +
"\n" +
" <span class=\"ngLabel\">{{i18n.ngTotalItemsLabel}} {{maxRows()}}</span><span ng-show=\"filterText.length > 0\" class=\"ngLabel\">({{i18n.ngShowingItemsLabel}} {{totalFilteredItemsLength()}})</span>\r" +
"\n" +
" </div>\r" +
"\n" +
" <div class=\"ngFooterSelectedItems\" ng-show=\"multiSelect\">\r" +
"\n" +
" <span class=\"ngLabel\">{{i18n.ngSelectedItemsLabel}} {{selectedItems.length}}</span>\r" +
"\n" +
" </div>\r" +
"\n" +
" </div>\r" +
"\n" +
" <div class=\"ngPagerContainer\" style=\"float: right; margin-top: 10px;\" ng-show=\"enablePaging\" ng-class=\"{'ngNoMultiSelect': !multiSelect}\">\r" +
"\n" +
" <div style=\"float:left; margin-right: 10px;\" class=\"ngRowCountPicker\">\r" +
"\n" +
" <span style=\"float: left; margin-top: 3px;\" class=\"ngLabel\">{{i18n.ngPageSizeLabel}}</span>\r" +
"\n" +
" <select style=\"float: left;height: 27px; width: 100px\" ng-model=\"pagingOptions.pageSize\" >\r" +
"\n" +
" <option ng-repeat=\"size in pagingOptions.pageSizes\">{{size}}</option>\r" +
"\n" +
" </select>\r" +
"\n" +
" </div>\r" +
"\n" +
" <div style=\"float:left; margin-right: 10px; line-height:25px;\" class=\"ngPagerControl\" style=\"float: left; min-width: 135px;\">\r" +
"\n" +
" <button type=\"button\" class=\"ngPagerButton\" ng-click=\"pageToFirst()\" ng-disabled=\"cantPageBackward()\" title=\"{{i18n.ngPagerFirstTitle}}\"><div class=\"ngPagerFirstTriangle\"><div class=\"ngPagerFirstBar\"></div></div></button>\r" +
"\n" +
" <button type=\"button\" class=\"ngPagerButton\" ng-click=\"pageBackward()\" ng-disabled=\"cantPageBackward()\" title=\"{{i18n.ngPagerPrevTitle}}\"><div class=\"ngPagerFirstTriangle ngPagerPrevTriangle\"></div></button>\r" +
"\n" +
" <input class=\"ngPagerCurrent\" min=\"1\" max=\"{{currentMaxPages}}\" type=\"number\" style=\"width:50px; height: 24px; margin-top: 1px; padding: 0 4px;\" ng-model=\"pagingOptions.currentPage\"/>\r" +
"\n" +
" <span class=\"ngGridMaxPagesNumber\" ng-show=\"maxPages() > 0\">/ {{maxPages()}}</span>\r" +
"\n" +
" <button type=\"button\" class=\"ngPagerButton\" ng-click=\"pageForward()\" ng-disabled=\"cantPageForward()\" title=\"{{i18n.ngPagerNextTitle}}\"><div class=\"ngPagerLastTriangle ngPagerNextTriangle\"></div></button>\r" +
"\n" +
" <button type=\"button\" class=\"ngPagerButton\" ng-click=\"pageToLast()\" ng-disabled=\"cantPageToLast()\" title=\"{{i18n.ngPagerLastTitle}}\"><div class=\"ngPagerLastTriangle\"><div class=\"ngPagerLastBar\"></div></div></button>\r" +
"\n" +
" </div>\r" +
"\n" +
" </div>\r" +
"\n" +
"</div>\r" +
"\n"
);


$templateCache.put('gridTemplate.html',
"<div class=\"ngTopPanel\" ng-class=\"{'ui-widget-header':jqueryUITheme, 'ui-corner-top': jqueryUITheme}\" ng-style=\"topPanelStyle()\">\n" +
" <div class=\"ngGroupPanel\" ng-show=\"showGroupPanel()\" ng-style=\"groupPanelStyle()\">\n" +
" <div class=\"ngGroupPanelDescription\" ng-show=\"configGroups.length == 0\">{{i18n.ngGroupPanelDescription}}</div>\n" +
" <ul ng-show=\"configGroups.length > 0\" class=\"ngGroupList\">\n" +
" <li class=\"ngGroupItem\" ng-repeat=\"group in configGroups\">\n" +
" <span class=\"ngGroupElement\">\n" +
" <span class=\"ngGroupName\">{{group.displayName}}\n" +
" <span ng-click=\"removeGroup($index)\" class=\"ngRemoveGroup\">x</span>\n" +
" </span>\n" +
" <span ng-hide=\"$last\" class=\"ngGroupArrow\"></span>\n" +
" </span>\n" +
" </li>\n" +
" </ul>\n" +
" </div>\n" +
" <div class=\"ngHeaderContainer\" ng-style=\"headerStyle()\">\n" +
" <div ng-header-row class=\"ngHeaderScroller\" ng-style=\"headerScrollerStyle()\"></div>\n" +
" </div>\n" +
" <div ng-grid-menu></div>\n" +
"</div>\n" +
"<div class=\"ngViewport\" tt-focus-view=\"true\" ng-keydown=\"handleRowKeypress($event);\" unselectable=\"on\" ng-viewport ng-class=\"{'ui-widget-content': jqueryUITheme}\" ng-style=\"viewportStyle()\">\n" +
" <div class=\"ngCanvas\" ng-style=\"canvasStyle()\">\n" +
" <div ng-style=\"rowStyle(row)\" ng-repeat=\"row in renderedRows\" ng-click=\"row.toggleSelected($event)\" ng-class=\"row.alternatingRowClass()\" ng-row></div>\n" +
" </div>\n" +
"</div>\n" +
"<div ng-grid-footer></div>\n"
"<div class=\"ngTopPanel\" ng-class=\"{'ui-widget-header':jqueryUITheme, 'ui-corner-top': jqueryUITheme}\" ng-style=\"topPanelStyle()\">\r" +
"\n" +
" <div class=\"ngGroupPanel\" ng-show=\"showGroupPanel()\" ng-style=\"groupPanelStyle()\">\r" +
"\n" +
" <div class=\"ngGroupPanelDescription\" ng-show=\"configGroups.length == 0\">{{i18n.ngGroupPanelDescription}}</div>\r" +
"\n" +
" <ul ng-show=\"configGroups.length > 0\" class=\"ngGroupList\">\r" +
"\n" +
" <li class=\"ngGroupItem\" ng-repeat=\"group in configGroups\">\r" +
"\n" +
" <span class=\"ngGroupElement\">\r" +
"\n" +
" <span class=\"ngGroupName\">{{group.displayName}}\r" +
"\n" +
" <span ng-click=\"removeGroup($index)\" class=\"ngRemoveGroup\">x</span>\r" +
"\n" +
" </span>\r" +
"\n" +
" <span ng-hide=\"$last\" class=\"ngGroupArrow\"></span>\r" +
"\n" +
" </span>\r" +
"\n" +
" </li>\r" +
"\n" +
" </ul>\r" +
"\n" +
" </div>\r" +
"\n" +
" <div class=\"ngHeaderContainer\" ng-style=\"headerStyle()\">\r" +
"\n" +
" <div ng-header-row class=\"ngHeaderScroller\" ng-style=\"headerScrollerStyle()\"></div>\r" +
"\n" +
" </div>\r" +
"\n" +
" <div ng-grid-menu></div>\r" +
"\n" +
"</div>\r" +
"\n" +
"<div class=\"ngViewport\" tt-focus-view=\"true\" ng-keydown=\"handleRowKeypress($event);\" unselectable=\"on\" ng-viewport ng-class=\"{'ui-widget-content': jqueryUITheme}\" ng-style=\"viewportStyle()\">\r" +
"\n" +
" <div class=\"ngCanvas\" ng-style=\"canvasStyle()\">\r" +
"\n" +
" <div ng-style=\"rowStyle(row)\" ng-repeat=\"row in renderedRows\" ng-click=\"row.toggleSelected($event)\" ng-class=\"row.alternatingRowClass()\" ng-row></div>\r" +
"\n" +
" </div>\r" +
"\n" +
"</div>\r" +
"\n" +
"<div ng-grid-footer></div>\r" +
"\n"
);


$templateCache.put('headerCellTemplate.html',
"<div class=\"ngHeaderSortColumn {{col.headerClass}}\" ng-style=\"{'cursor': col.cursor}\" ng-class=\"{ 'ngSorted': !col.noSortVisible() }\">\n" +
" <div ng-click=\"col.sort($event)\" ng-class=\"'colt' + col.index\" class=\"ngHeaderText\">{{col.displayName}}</div>\n" +
" <div class=\"ngSortButtonDown\" ng-click=\"col.sort($event)\" ng-show=\"col.showSortButtonDown()\"></div>\n" +
" <div class=\"ngSortButtonUp\" ng-click=\"col.sort($event)\" ng-show=\"col.showSortButtonUp()\"></div>\n" +
" <div class=\"ngSortPriority\">{{col.sortPriority}}</div>\n" +
" <div ng-class=\"{ ngPinnedIcon: col.pinned, ngUnPinnedIcon: !col.pinned }\" ng-click=\"togglePin(col)\" ng-show=\"col.pinnable\"></div>\n" +
"</div>\n" +
"<div ng-show=\"col.resizable\" class=\"ngHeaderGrip\" ng-click=\"col.gripClick($event)\" ng-mousedown=\"col.gripOnMouseDown($event)\"></div>\n"
"<div class=\"ngHeaderSortColumn {{col.headerClass}}\" ng-style=\"{'cursor': col.cursor}\" ng-class=\"{ 'ngSorted': !col.noSortVisible() }\">\r" +
"\n" +
" <div ng-click=\"col.sort($event)\" ng-class=\"'colt' + col.index\" class=\"ngHeaderText\">{{col.displayName}}</div>\r" +
"\n" +
" <div class=\"ngSortButtonDown\" ng-click=\"col.sort($event)\" ng-show=\"col.showSortButtonDown()\"></div>\r" +
"\n" +
" <div class=\"ngSortButtonUp\" ng-click=\"col.sort($event)\" ng-show=\"col.showSortButtonUp()\"></div>\r" +
"\n" +
" <div class=\"ngSortPriority\">{{col.sortPriority}}</div>\r" +
"\n" +
" <div ng-class=\"{ ngPinnedIcon: col.pinned, ngUnPinnedIcon: !col.pinned }\" ng-click=\"togglePin(col)\" ng-show=\"col.pinnable\"></div>\r" +
"\n" +
"</div>\r" +
"\n" +
"<div ng-show=\"col.resizable\" class=\"ngHeaderGrip\" ng-click=\"col.gripClick($event)\" ng-mousedown=\"col.gripOnMouseDown($event)\"></div>\r" +
"\n"
);


$templateCache.put('headerRowTemplate.html',
"<div ng-style=\"{ height: col.headerRowHeight }\" ng-repeat=\"col in renderedColumns\" ng-class=\"col.colIndex()\" class=\"ngHeaderCell\">\n" +
"\t<div class=\"ngVerticalBar\" ng-style=\"{height: col.headerRowHeight}\" ng-class=\"{ ngVerticalBarVisible: !$last }\">&nbsp;</div>\n" +
"\t<div ng-header-cell></div>\n" +
"<div ng-style=\"{ height: col.headerRowHeight }\" ng-repeat=\"col in renderedColumns\" ng-class=\"col.colIndex()\" class=\"ngHeaderCell\">\r" +
"\n" +
"\t<div class=\"ngVerticalBar\" ng-style=\"{height: col.headerRowHeight}\" ng-class=\"{ ngVerticalBarVisible: !$last }\">&nbsp;</div>\r" +
"\n" +
"\t<div ng-header-cell></div>\r" +
"\n" +
"</div>"
);


$templateCache.put('menuTemplate.html',
"<div ng-show=\"showColumnMenu || showFilter\" class=\"ngHeaderButton\" ng-click=\"toggleShowMenu()\">\n" +
" <div class=\"ngHeaderButtonArrow\"></div>\n" +
"</div>\n" +
"<div ng-show=\"showMenu\" class=\"ngColMenu\">\n" +
" <div ng-show=\"showFilter\">\n" +
" <input placeholder=\"{{i18n.ngSearchPlaceHolder}}\" type=\"text\" ng-model=\"filterText\"/>\n" +
" </div>\n" +
" <div ng-show=\"showColumnMenu\">\n" +
" <span class=\"ngMenuText\">{{i18n.ngMenuText}}</span>\n" +
" <ul class=\"ngColList\">\n" +
" <li class=\"ngColListItem\" ng-repeat=\"col in columns | ngColumns\">\n" +
" <label><input ng-disabled=\"col.pinned\" type=\"checkbox\" class=\"ngColListCheckbox\" ng-model=\"col.visible\"/>{{col.displayName}}</label>\n" +
"\t\t\t\t<a title=\"Group By\" ng-class=\"col.groupedByClass()\" ng-show=\"col.groupable && col.visible\" ng-click=\"groupBy(col)\"></a>\n" +
"\t\t\t\t<span class=\"ngGroupingNumber\" ng-show=\"col.groupIndex > 0\">{{col.groupIndex}}</span> \n" +
" </li>\n" +
" </ul>\n" +
" </div>\n" +
"<div ng-show=\"showColumnMenu || showFilter\" class=\"ngHeaderButton\" ng-click=\"toggleShowMenu()\">\r" +
"\n" +
" <div class=\"ngHeaderButtonArrow\"></div>\r" +
"\n" +
"</div>\r" +
"\n" +
"<div ng-show=\"showMenu\" class=\"ngColMenu\">\r" +
"\n" +
" <div ng-show=\"showFilter\">\r" +
"\n" +
" <input placeholder=\"{{i18n.ngSearchPlaceHolder}}\" type=\"text\" ng-model=\"filterText\"/>\r" +
"\n" +
" </div>\r" +
"\n" +
" <div ng-show=\"showColumnMenu\">\r" +
"\n" +
" <span class=\"ngMenuText\">{{i18n.ngMenuText}}</span>\r" +
"\n" +
" <ul class=\"ngColList\">\r" +
"\n" +
" <li class=\"ngColListItem\" ng-repeat=\"col in columns | ngColumns\">\r" +
"\n" +
" <label><input ng-disabled=\"col.pinned\" type=\"checkbox\" class=\"ngColListCheckbox\" ng-model=\"col.visible\"/>{{col.displayName}}</label>\r" +
"\n" +
"\t\t\t\t<a title=\"Group By\" ng-class=\"col.groupedByClass()\" ng-show=\"col.groupable && col.visible\" ng-click=\"groupBy(col)\"></a>\r" +
"\n" +
"\t\t\t\t<span class=\"ngGroupingNumber\" ng-show=\"col.groupIndex > 0\">{{col.groupIndex}}</span> \r" +
"\n" +
" </li>\r" +
"\n" +
" </ul>\r" +
"\n" +
" </div>\r" +
"\n" +
"</div>"
);


$templateCache.put('rowTemplate.html',
"<div ng-style=\"{ 'cursor': row.cursor }\" ng-repeat=\"col in renderedColumns\" ng-class=\"col.colIndex()\" class=\"ngCell {{col.cellClass}}\">\n" +
"\t<div class=\"ngVerticalBar\" ng-style=\"{height: rowHeight}\" ng-class=\"{ ngVerticalBarVisible: !$last }\">&nbsp;</div>\n" +
"\t<div ng-cell></div>\n" +
"<div ng-style=\"{ 'cursor': row.cursor }\" ng-repeat=\"col in renderedColumns\" ng-class=\"col.colIndex()\" class=\"ngCell {{col.cellClass}}\">\r" +
"\n" +
"\t<div class=\"ngVerticalBar\" ng-style=\"{height: rowHeight}\" ng-class=\"{ ngVerticalBarVisible: !$last }\">&nbsp;</div>\r" +
"\n" +
"\t<div ng-cell></div>\r" +
"\n" +
"</div>"
);

Expand Down
Loading

0 comments on commit 787a8fd

Please sign in to comment.