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

Side by Side Diff: appengine/monorail/static/js/tracker/tracker-util.js

Issue 1868553004: Open Source Monorail (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Rebase Created 4 years, 8 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
OLDNEW
(Empty)
1 /* Copyright 2016 The Chromium Authors. All Rights Reserved.
2 *
3 * Use of this source code is governed by a BSD-style
4 * license that can be found in the LICENSE file or at
5 * https://developers.google.com/open-source/licenses/bsd
6 */
7
8 /**
9 * This file contains JS utilities used by other JS files in Monorail.
10 */
11
12
13 /**
14 * Add an indexOf method to all arrays, if this brower's JS implementation
15 * does not already have it.
16 * @param {Object} item The item to find
17 * @returns {number} The index of the given item, or -1 if not found.
18 */
19 if (Array.prototype.indexOf == undefined) {
20 Array.prototype.indexOf = function(item) {
21 for (var i = 0; i < this.length; ++i) {
22 if (this[i] == item) return i;
23 }
24 return -1;
25 }
26 }
27
28
29 /**
30 * This function works around a FF HTML layout problem. The table
31 * width is somehow rendered at 100% when the table contains a
32 * display:none element, later, when that element is displayed, the
33 * table renders at the correct width. The work-around is to have the
34 * element initiallye displayed so that the table renders properly,
35 * but then immediately hide the element until it is needed.
36 *
37 * TODO(jrobbins): Find HTML markup that FF can render more
38 * consistently. After that, I can remove this hack.
39 */
40 function TKR_forceProperTableWidth() {
41 var e = $('confirmarea');
42 if (e) e.style.display='none';
43 }
OLDNEW
« no previous file with comments | « appengine/monorail/static/js/tracker/tracker-onload.js ('k') | appengine/monorail/static/js/tracker/trackerac_test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698