collection: new Backbone.Collection r.facets
@layout.facetsRegion.show @codingRulesFacetsView
+ @layout.onResize()
+
App.fetchFirstPage = (fromFacets = false) ->
className: 'navigator coding-rules-navigator'
template: Templates['coding-rules-layout']
spinner: '<i class="spinner"></i>'
+ storageKey: 'codingRulesResultsWidth'
regions:
facetsRegion: '.navigator-facets'
+ ui:
+ side: '.navigator-side'
+ results: '.navigator-results'
+ details: '.navigator-details'
+ resizer: '.navigator-resizer'
+
+
initialize: ->
jQuery(window).on 'resize', => @onResize()
+ @isResize = false
+ jQuery('body').on 'mousemove', (e) => @processResize(e)
+ jQuery('body').on 'mouseup', => @stopResize()
+
+
+ onRender: ->
+ @ui.resizer.on 'mousedown', (e) => @startResize(e)
+
+ resultsWidth = localStorage.getItem @storageKey
+ if resultsWidth
+ @$(@resultsRegion.el).width +resultsWidth
+ @ui.side.width +resultsWidth + 20
+
onResize: ->
footerEl = jQuery('#footer')
footerHeight = footerEl.outerHeight true
- resultsEl = jQuery('.navigator-results')
+ resultsEl = @ui.results
resultsHeight = jQuery(window).height() - resultsEl.offset().top -
parseInt(resultsEl.css('margin-bottom'), 10) - footerHeight
resultsEl.height resultsHeight
- detailsEl = jQuery('.navigator-details')
+ detailsEl = @ui.details
detailsWidth = jQuery(window).width() - detailsEl.offset().left -
parseInt(detailsEl.css('margin-right'), 10)
detailsHeight = jQuery(window).height() - detailsEl.offset().top -
showSpinner: (region) ->
@$(@[region].el).html @spinner
+
+
+ startResize: (e) ->
+ @isResize = true
+ @originalWidth = @ui.results.width()
+ @x = e.clientX
+ jQuery('html').attr('unselectable', 'on').css('user-select', 'none').on('selectstart', false)
+
+
+ processResize: (e) ->
+ if @isResize
+ delta = e.clientX - @x
+ @$(@resultsRegion.el).width @originalWidth + delta
+ @ui.side.width @originalWidth + 20 + delta
+ localStorage.setItem @storageKey, @ui.results.width()
+ @onResize()
+
+
+ stopResize: ->
+ if @isResize
+ jQuery('html').attr('unselectable', 'off').css('user-select', 'all').off('selectstart')
+ @isResize = false
<div class="navigator-side">
<div class="navigator-actions"></div>
<div class="navigator-results"></div>
+ <a class="navigator-resizer"><i class="icon-resizer"></i></a>
</div>
<div class="navigator-main">
<div class="navigator-details"></div>
NavigatorApp.addInitializer(function () {
- var onResize = function() {
+ this.onResize = function() {
var footerEl = jQuery('#footer'),
footerHeight = footerEl.outerHeight(true);
parseInt(detailsEl.css('margin-bottom'), 10) - footerHeight;
detailsEl.width(detailsWidth).height(detailsHeight);
};
- jQuery(window).on('resize', onResize);
- onResize();
+ jQuery(window).on('resize', this.onResize);
+ this.onResize();
});
+ NavigatorApp.addInitializer(function () {
+ var that = this;
+ jQuery('body')
+ .on('mousemove', function (e) { that.processResize(e); })
+ .on('mouseup', function (e) { that.stopResize(); });
+ jQuery('.navigator-resizer').on('mousedown', function (e) { that.startResize(e); });
+
+ var resultsWidth = localStorage.getItem('issuesResultsWidth');
+ if (resultsWidth) {
+ jQuery('.navigator-results').width(+resultsWidth);
+ jQuery('.navigator-side').width(+resultsWidth + 20);
+ }
+ });
+
+
+ NavigatorApp.startResize = function (e) {
+ this.isResize = true;
+ this.originalWidth = jQuery('.navigator-results').width();
+ this.x = e.clientX;
+ jQuery('html').attr('unselectable', 'on').css('user-select', 'none').on('selectstart', false);
+ };
+
+
+ NavigatorApp.processResize = function (e) {
+ if (this.isResize) {
+ var delta = e.clientX - this.x;
+ jQuery('.navigator-results').width(this.originalWidth + delta);
+ jQuery('.navigator-side').width(this.originalWidth + 20 + delta);
+ localStorage.setItem('issuesResultsWidth', jQuery('.navigator-results').width());
+ this.onResize();
+ }
+ };
+
+
+ NavigatorApp.stopResize = function() {
+ if (this.isResize) {
+ jQuery('html').attr('unselectable', 'off').css('user-select', 'all').off('selectstart');
+ }
+ this.isResize = false;
+ };
+
+
NavigatorApp.getQuery = function (withoutId) {
var query = this.filterBarView.getQuery();
if (!withoutId && this.favoriteFilter.id) {
content: "\f016";
font-size: @iconSmallFontSize;
}
+.icon-resizer:before {
+ content: "\f142";
+ color: @darkGrey;
+ font-size: @iconFontSize;
+}
/*
}
.navigator-side {
+ position: relative;
display: table-cell;
vertical-align: top;
width: @navigatorResultsWidth + 2 * @navigatorPadding;
+ min-width: 275px + 2 * @navigatorPadding;
+ max-width: 600px + 2 * @navigatorPadding;
}
.navigator-main {
}
.navigator-results {
+ position: relative;
+ z-index: 2;
width: @navigatorResultsWidth;
+ min-width: 275px;
+ max-width: 600px;
margin: @navigatorPadding;
.box-sizing(border-box);
}
.navigator-actions {
- .clearfix;
- width: @navigatorResultsWidth;
+ position: relative;
+ z-index: 4;
margin: 0 @navigatorPadding @navigatorPadding;
border: 1px solid @navigatorBorderLightColor;
.box-sizing(border-box);
+ .clearfix;
}
.navigator-details {
position: relative;
- margin: 0 @navigatorPadding @navigatorPadding 0;
+ margin: 0 @navigatorPadding @navigatorPadding @navigatorPadding;
+}
+
+.navigator-resizer {
+ position: absolute;
+ top: 50%; right: -1px;
+ cursor: col-resize;
}
.navigator-notes {
}
&:before {
- position: fixed;
+ position: absolute;
z-index: 3;
- top: @navigatorTopOffset + @navigatorHeaderHeight + @navigatorFiltersHeight + @navigatorStatusHeight;
- bottom: 0;
- left: 0;
- width: @navigatorResultsWidth - 1px;
+ top: 0; bottom: 0; left: 0; right: 0;
}
}
}
.trans;
&:hover {
- background-color: @navigatorBarBackground;
+ background-color: @navigatorHover;
}
}
.navigator-actions-order-choices {
- .navigator-element;
- top: @navigatorTopOffset + @navigatorHeaderHeight + @navigatorFiltersHeight + @navigatorStatusHeight;
- left: 0;
+ position: absolute;
+ top: 100%;
+ left: -1px;
min-width: @navigatorResultsWidth / 2;
background-color: #fff;
- border-bottom: 1px solid @navigatorBorderLightColor;
- border-right: 1px solid @navigatorBorderLightColor;
+ border: 1px solid @navigatorBorderLightColor;
+ box-shadow: @defaultShadow;
overflow: hidden;
display: none;
.navigator-actions-total {
float: right;
+ height: @navigatorStatusHeight;
line-height: @navigatorStatusHeight;
}
min-width: 100px;
border: 1px solid @darkGrey;
background: #fff;
- box-shadow: 10px 10px 20px rgba(0, 0, 0, 0.5);
+ box-shadow: @defaultShadow;
font-size: @baseFontSize;
transition: opacity 0.3s ease;
margin: 0 8px;
font-size: @smallFontSize;
}
-}
+}
\ No newline at end of file
+/*
+ * Shadows
+ */
+
+@defaultShadow: 10px 10px 20px rgba(0, 0, 0, 0.5);
+
+
+
/*
* Transitions
*/
<div class="navigator-side">
<div class="navigator-actions"></div>
<div class="navigator-results"></div>
+ <a class="navigator-resizer"><i class="icon-resizer"></i></a>
</div>
<div class="navigator-main">
<div class="navigator-notes"><%= message('issue_filter.max_results_reached', :params => 10000) -%></div>
<glyph unicode="" d="M365.714 341.714v-40q0-24-22.286-33.714-7.429-2.857-14.286-2.857-15.429 0-25.714 10.857l-292.571 292.571q-10.857 10.857-10.857 25.714t10.857 25.714l292.571 292.571q16.571 17.714 40 8 22.286-9.714 22.286-33.714v-39.429l-226.857-227.429q-10.857-10.857-10.857-25.714t10.857-25.714zM1024 320q0-33.143-9.714-76.286t-22-78.857-27.429-71.429-23.143-51.714l-11.429-22.857q-4.571-9.714-16-9.714-3.429 0-5.143 0.571-14.286 4.571-13.143 19.429 24.571 228.571-60.571 322.857-36.571 40.571-97.429 63.143t-152.857 30v-143.429q0-24-22.286-33.714-7.429-2.857-14.286-2.857-15.429 0-25.714 10.857l-292.571 292.571q-10.857 10.857-10.857 25.714t10.857 25.714l292.571 292.571q16.571 17.714 40 8 22.286-9.714 22.286-33.714v-149.714q234.857-16 342.286-126.286 96.571-98.857 96.571-290.857z" />
<glyph unicode="" d="M164.571 118.857q0 22.857-16 38.857t-38.857 16-38.857-16-16-38.857 16-38.857 38.857-16 38.857 16 16 38.857zM164.571 777.143q0 22.857-16 38.857t-38.857 16-38.857-16-16-38.857 16-38.857 38.857-16 38.857 16 16 38.857zM530.286 704q0 22.857-16 38.857t-38.857 16-38.857-16-16-38.857 16-38.857 38.857-16 38.857 16 16 38.857zM585.143 704q0-29.714-14.857-55.143t-40-39.714q-1.143-164-129.143-236.571-38.857-21.714-116-46.286-73.143-22.857-96.857-40.571t-23.714-57.143v-14.857q25.143-14.286 40-39.714t14.857-55.143q0-45.714-32-77.714t-77.714-32-77.714 32-32 77.714q0 29.714 14.857 55.143t40 39.714v468.571q-25.143 14.286-40 39.714t-14.857 55.143q0 45.714 32 77.714t77.714 32 77.714-32 32-77.714q0-29.714-14.857-55.143t-40-39.714v-284q30.857 14.857 88 32.571 31.429 9.714 50 16.857t40.286 17.714 33.714 22.571 23.143 29.143 16 39.714 4.857 52.286q-25.143 14.286-40 39.714t-14.857 55.143q0 45.714 32 77.714t77.714 32 77.714-32 32-77.714z" horiz-adv-x="585" />
<glyph unicode="" d="M250.857 233.714l-146.286-146.286q-5.714-5.143-13.143-5.143-6.857 0-13.143 5.143-5.143 5.714-5.143 13.143t5.143 13.143l146.286 146.286q5.714 5.143 13.143 5.143t13.143-5.143q5.143-5.714 5.143-13.143t-5.143-13.143zM347.429 210.286v-182.857q0-8-5.143-13.143t-13.143-5.143-13.143 5.143-5.143 13.143v182.857q0 8 5.143 13.143t13.143 5.143 13.143-5.143 5.143-13.143zM219.429 338.286q0-8-5.143-13.143t-13.143-5.143h-182.857q-8 0-13.143 5.143t-5.143 13.143 5.143 13.143 13.143 5.143h182.857q8 0 13.143-5.143t5.143-13.143zM941.714 265.143q0-68.571-48.571-116l-84-83.429q-47.429-47.429-116-47.429-69.143 0-116.571 48.571l-190.857 191.429q-12 12-24 32l136.571 10.286 156-156.571q15.429-15.429 38.857-15.714t38.857 15.143l84 83.429q16 16 16 38.286 0 22.857-16 38.857l-156.571 157.143 10.286 136.571q20-12 32-24l192-192q48-49.143 48-116.571zM589.143 678.857l-136.571-10.286-156 156.571q-16 16-38.857 16-22.286 0-38.857-15.429l-84-83.429q-16-16-16-38.286 0-22.857 16-38.857l156.571-156.571-10.286-137.143q-20 12-32 24l-192 192q-48 49.143-48 116.571 0 68.571 48.571 116l84 83.429q47.429 47.429 116 47.429 69.143 0 116.571-48.571l190.857-191.429q12-12 24-32zM950.857 630.857q0-8-5.143-13.143t-13.143-5.143h-182.857q-8 0-13.143 5.143t-5.143 13.143 5.143 13.143 13.143 5.143h182.857q8 0 13.143-5.143t5.143-13.143zM640 941.714v-182.857q0-8-5.143-13.143t-13.143-5.143-13.143 5.143-5.143 13.143v182.857q0 8 5.143 13.143t13.143 5.143 13.143-5.143 5.143-13.143zM872.571 855.429l-146.286-146.286q-6.286-5.143-13.143-5.143t-13.143 5.143q-5.143 5.714-5.143 13.143t5.143 13.143l146.286 146.286q5.714 5.143 13.143 5.143t13.143-5.143q5.143-5.714 5.143-13.143t-5.143-13.143z" horiz-adv-x="951" />
+<glyph unicode="" d="M219.429 246.857v-109.714q0-22.857-16-38.857t-38.857-16h-109.714q-22.857 0-38.857 16t-16 38.857v109.714q0 22.857 16 38.857t38.857 16h109.714q22.857 0 38.857-16t16-38.857zM219.429 539.429v-109.714q0-22.857-16-38.857t-38.857-16h-109.714q-22.857 0-38.857 16t-16 38.857v109.714q0 22.857 16 38.857t38.857 16h109.714q22.857 0 38.857-16t16-38.857zM219.429 832v-109.714q0-22.857-16-38.857t-38.857-16h-109.714q-22.857 0-38.857 16t-16 38.857v109.714q0 22.857 16 38.857t38.857 16h109.714q22.857 0 38.857-16t16-38.857z" horiz-adv-x="219" />
<glyph unicode="" d="M932.571 411.429q0-14.857-10.857-25.714t-25.714-10.857h-128q0-97.714-38.286-165.714l118.857-119.429q10.857-10.857 10.857-25.714t-10.857-25.714q-10.286-10.857-25.714-10.857t-25.714 10.857l-113.143 112.571q-2.857-2.857-8.571-7.429t-24-16.286-37.143-20.857-46.857-16.571-55.429-7.429v512h-73.143v-512q-29.143 0-58 7.714t-49.714 18.857-37.714 22.286-24.857 18.571l-8.571 8-104.571-118.286q-11.429-12-27.429-12-13.714 0-24.571 9.143-10.857 10.286-11.714 25.429t8.857 26.571l115.429 129.714q-33.143 65.143-33.143 156.571h-128q-14.857 0-25.714 10.857t-10.857 25.714 10.857 25.714 25.714 10.857h128v168l-98.857 98.857q-10.857 10.857-10.857 25.714t10.857 25.714 25.714 10.857 25.714-10.857l98.857-98.857h482.286l98.857 98.857q10.857 10.857 25.714 10.857t25.714-10.857 10.857-25.714-10.857-25.714l-98.857-98.857v-168h128q14.857 0 25.714-10.857t10.857-25.714zM658.286 740.571h-365.714q0 76 53.429 129.429t129.429 53.429 129.429-53.429 53.429-129.429z" horiz-adv-x="951" />
</font></defs></svg>
\ No newline at end of file