Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(64)

Side by Side Diff: ui/webui/resources/js/cr/ui/bubble.js

Issue 2664613002: Drop .clang-format in ui/webui now that Chromium JS defaults are the same (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/webui/resources/js/analytics.js ('k') | ui/webui/resources/js/jstemplate_compiled.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // require: event_tracker.js 5 // require: event_tracker.js
6 6
7 // TODO(vitalyp): Inline the enums below into cr.ui definition function, remove 7 // TODO(vitalyp): Inline the enums below into cr.ui definition function, remove
8 // cr.exportPath() call and remove exportPath from exports in cr.js when this 8 // cr.exportPath() call and remove exportPath from exports in cr.js when this
9 // issue will be fixed: 9 // issue will be fixed:
10 // https://github.com/google/closure-compiler/issues/544 10 // https://github.com/google/closure-compiler/issues/544
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 anchorMid - BubbleBase.ARROW_OFFSET; 184 anchorMid - BubbleBase.ARROW_OFFSET;
185 var max_left_pos = 185 var max_left_pos =
186 documentWidth - bubble.width - BubbleBase.MIN_VIEWPORT_EDGE_MARGIN; 186 documentWidth - bubble.width - BubbleBase.MIN_VIEWPORT_EDGE_MARGIN;
187 var min_left_pos = BubbleBase.MIN_VIEWPORT_EDGE_MARGIN; 187 var min_left_pos = BubbleBase.MIN_VIEWPORT_EDGE_MARGIN;
188 if (document.documentElement.dir == 'rtl') 188 if (document.documentElement.dir == 'rtl')
189 left = Math.min(Math.max(left, min_left_pos), max_left_pos); 189 left = Math.min(Math.max(left, min_left_pos), max_left_pos);
190 else 190 else
191 left = Math.max(Math.min(left, max_left_pos), min_left_pos); 191 left = Math.max(Math.min(left, max_left_pos), min_left_pos);
192 var arrowTip = Math.min( 192 var arrowTip = Math.min(
193 Math.max( 193 Math.max(
194 arrow.width / 2, this.arrowAtRight_ ? 194 arrow.width / 2,
195 left + bubble.width - anchorMid : 195 this.arrowAtRight_ ? left + bubble.width - anchorMid :
196 anchorMid - left), 196 anchorMid - left),
197 bubble.width - arrow.width / 2); 197 bubble.width - arrow.width / 2);
198 198
199 // Work out the vertical placement, attempting to fit the bubble 199 // Work out the vertical placement, attempting to fit the bubble
200 // entirely into view. The following placements are considered in 200 // entirely into view. The following placements are considered in
201 // decreasing order of preference: 201 // decreasing order of preference:
202 // * Outside the anchor, arrow tip touching the anchor (arrow at 202 // * Outside the anchor, arrow tip touching the anchor (arrow at
203 // top/bottom as specified by the arrow location). 203 // top/bottom as specified by the arrow location).
204 // * Outside the anchor, arrow tip touching the anchor (arrow at 204 // * Outside the anchor, arrow tip touching the anchor (arrow at
205 // bottom/top, opposite the specified arrow location). 205 // bottom/top, opposite the specified arrow location).
206 // * Outside the anchor, arrow tip overlapping the anchor (arrow at 206 // * Outside the anchor, arrow tip overlapping the anchor (arrow at
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after
534 }, 534 },
535 }; 535 };
536 536
537 537
538 return { 538 return {
539 BubbleBase: BubbleBase, 539 BubbleBase: BubbleBase,
540 Bubble: Bubble, 540 Bubble: Bubble,
541 AutoCloseBubble: AutoCloseBubble 541 AutoCloseBubble: AutoCloseBubble
542 }; 542 };
543 }); 543 });
OLDNEW
« no previous file with comments | « ui/webui/resources/js/analytics.js ('k') | ui/webui/resources/js/jstemplate_compiled.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698