Commit b2274aa2 authored by rbpotter's avatar rbpotter Committed by Commit Bot

CrActionMenu: Split AnchorAlignment into a separate file

The AnchorAlignment enum is used in a few places outside of
cr_action_menu.js (tests, settings pages). Move it into a separate file
so that a module exporting it can be easily autogenerated for Polymer 3.


Bug: 965770
Change-Id: I88121da31ce9f016c89fa2a9a83a6fda263094b7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1795315Reviewed-by: default avatarDemetrios Papadopoulos <dpapad@chromium.org>
Commit-Queue: Rebekah Potter <rbpotter@chromium.org>
Cr-Commit-Position: refs/heads/master@{#695386}
parent 9fa6fc9b
<link rel="import" href="chrome://resources/html/polymer.html">
<link rel="import" href="chrome://resources/cr_elements/cr_action_menu/anchor_alignment.html">
<link rel="import" href="chrome://resources/cr_elements/cr_action_menu/cr_action_menu.html">
<link rel="import" href="chrome://resources/cr_elements/cr_icon_button/cr_icon_button.html">
<link rel="import" href="chrome://resources/cr_elements/icons.html">
......
<link rel="import" href="chrome://resources/html/polymer.html">
<link rel="import" href="chrome://resources/cr_elements/cr_action_menu/anchor_alignment.html">
<link rel="import" href="chrome://resources/cr_elements/cr_action_menu/cr_action_menu.html">
<link rel="import" href="chrome://resources/cr_elements/cr_icon_button/cr_icon_button.html">
<link rel="import" href="chrome://resources/cr_elements/icons.html">
......
......@@ -6,12 +6,17 @@ import("//third_party/closure_compiler/compile_js.gni")
js_type_check("closure_compile") {
deps = [
":anchor_alignment",
":cr_action_menu",
]
}
js_library("anchor_alignment") {
}
js_library("cr_action_menu") {
deps = [
":anchor_alignment",
"//ui/webui/resources/js:assert",
"//ui/webui/resources/js:util",
"//ui/webui/resources/js/cr/ui:focus_row",
......
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
/**
* @enum {number}
* @const
*/
const AnchorAlignment = {
BEFORE_START: -2,
AFTER_START: -1,
CENTER: 0,
BEFORE_END: 1,
AFTER_END: 2,
};
......@@ -5,6 +5,7 @@
<link rel="import" href="../../html/cr/ui/focus_without_ink.html">
<link rel="import" href="../../html/util.html">
<link rel="import" href="../shared_vars_css.html">
<link rel="import" href="anchor_alignment.html">
<dom-module id="cr-action-menu">
<template>
......
......@@ -34,18 +34,6 @@ let ShowAtConfig;
*/
let ShowAtPositionConfig;
/**
* @enum {number}
* @const
*/
const AnchorAlignment = {
BEFORE_START: -2,
AFTER_START: -1,
CENTER: 0,
BEFORE_END: 1,
AFTER_END: 2,
};
/** @const {string} */
const DROPDOWN_ITEM_CLASS = 'dropdown-item';
......
......@@ -5,6 +5,14 @@
file="cr_elements/action_link_css.html"
type="chrome_html"
compress="gzip" />
<structure name="IDR_CR_ELEMENTS_CR_ACTION_MENU_ANCHOR_ALIGNMENT_HTML"
file="cr_elements/cr_action_menu/anchor_alignment.html"
type="chrome_html"
compress="gzip" />
<structure name="IDR_CR_ELEMENTS_CR_ACTION_MENU_ANCHOR_ALIGNMENT_JS"
file="cr_elements/cr_action_menu/anchor_alignment.js"
type="chrome_html"
compress="gzip" />
<structure name="IDR_CR_ELEMENTS_CR_ACTION_MENU_HTML"
file="cr_elements/cr_action_menu/cr_action_menu.html"
type="chrome_html"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment