diff --git a/wp-admin/css/customize-nav-menus-rtl.css b/wp-admin/css/customize-nav-menus-rtl.css
new file mode 100644
index 0000000000..be793e52d9
--- /dev/null
+++ b/wp-admin/css/customize-nav-menus-rtl.css
@@ -0,0 +1,964 @@
+#accordion-section-menu_locations {
+ position: relative;
+ margin-bottom: 15px;
+}
+
+.menu-in-location,
+.menu-in-locations {
+ display: block;
+ color: #999;
+ font-weight: 600;
+ font-size: 10px;
+}
+
+#customize-controls .control-section .accordion-section-title:focus .menu-in-location,
+#customize-controls .control-section .accordion-section-title:hover .menu-in-location,
+#customize-controls .control-section .accordion-section-title:focus .menu-in-locations,
+#customize-controls .control-section .accordion-section-title:hover .menu-in-locations {
+ color: #fff;
+}
+
+.wp-customizer .menu-item-bar .menu-item-handle,
+.wp-customizer .menu-item-settings,
+.wp-customizer .menu-item-settings .description-thin {
+ -webkit-box-sizing: border-box;
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+}
+
+.wp-customizer .menu-item-bar {
+ margin: 0;
+}
+
+.wp-customizer .menu-item-bar .menu-item-handle {
+ max-width: 100%;
+ background: #fff;
+}
+
+.wp-customizer .menu-item-handle .item-title {
+ margin-left: 0;
+}
+
+.wp-customizer .menu-item-handle .item-type {
+ padding: 1px 5px 0 15px;
+ float: left;
+ text-align: left;
+}
+
+.wp-customizer .menu-item-settings {
+ max-width: 100%;
+ overflow: hidden;
+ padding: 10px;
+ background: #eee;
+ border: 1px solid #999;
+ border-top: none;
+}
+
+.wp-customizer .menu-item-settings .description-thin {
+ width: 100%;
+ height: auto;
+ margin: 0 0 8px 0;
+}
+
+.wp-customizer .menu-item-settings input[type="text"] {
+ width: 100%;
+}
+
+.wp-customizer .menu-item-settings .submitbox {
+ margin: 0;
+ padding: 0;
+}
+
+.wp-customizer .menu-item-settings .link-to-original {
+ padding: 5px 0;
+ border: none;
+ font-style: normal;
+ margin: 0;
+ width: 100%;
+}
+
+.wp-customizer .menu-item .submitbox .submitdelete {
+ display: block;
+ float: right;
+ margin: 6px 0 0;
+ padding: 0;
+ cursor: pointer;
+}
+
+.wp-customizer .menu-item .submitbox .submitdelete:focus {
+ -webkit-box-shadow: 0 0 0 1px #5b9dd9, 0 0 2px 1px rgba(30, 140, 190, .8);
+ box-shadow: 0 0 0 1px #5b9dd9, 0 0 2px 1px rgba(30, 140, 190, .8);
+}
+
+/* Menu-item reordering nav. */
+#customize-theme-controls button.reorder-toggle {
+ padding: 5px 8px;
+}
+
+.menu-item-reorder-nav {
+ display: none;
+ background-color: #fff;
+ position: absolute;
+ top: 0;
+ left: 0;
+}
+
+#customize-theme-controls .reordering .add-new-menu-item {
+ opacity: 0.2;
+ pointer-events: none;
+ cursor: not-allowed;
+}
+
+.menu-item-reorder-nav button {
+ position: relative;
+ overflow: hidden;
+ float: right;
+ display: block;
+ width: 30px;
+ height: 40px;
+ color: #82878c;
+ text-indent: -9999px;
+ cursor: pointer;
+ background: transparent;
+ border: none;
+ -webkit-box-shadow: none;
+ box-shadow: none;
+ outline: none;
+}
+
+.menu-item-reorder-nav button:before {
+ display: inline-block;
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+ font: normal 20px/40px dashicons;
+ text-align: center;
+ text-indent: 0;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+}
+
+.menu-item-reorder-nav button:hover,
+.menu-item-reorder-nav button:focus {
+ color: #191e23;
+ background: #eee;
+}
+
+.menus-move-down:before {
+ content: '\f347';
+}
+
+.menus-move-up:before {
+ content: '\f343';
+}
+
+.menus-move-left:before {
+ content: '\f341';
+}
+
+.menus-move-right:before {
+ content: '\f345';
+}
+
+.move-up-disabled .menus-move-up,
+.move-down-disabled .menus-move-down,
+.move-right-disabled .menus-move-right,
+.move-left-disabled .menus-move-left,
+.menu-item-depth-0 .menus-move-left,
+.menu-item-depth-10 .menus-move-right {
+ color: #d5d5d5 !important;
+ background-color: #fff !important;
+ cursor: default;
+ pointer-events: none;
+}
+
+.menu-item-reorder-nav:before {
+ content: "";
+ display: block;
+ position: absolute;
+ right: -10px;
+ width: 10px;
+ height: 40px;
+ background: -webkit-linear-gradient(right, rgba(250,250,250,0) 0%,rgba(250,250,250,1) 100%);
+ background: -webkit-gradient(linear, right top, left top, from(rgba(250,250,250,0)), to(rgba(250,250,250,1)));
+ background: -webkit-linear-gradient(right, rgba(250,250,250,0) 0%, rgba(250,250,250,1) 100%);
+ background: linear-gradient(to left, rgba(250,250,250,0) 0%,rgba(250,250,250,1) 100%);
+}
+
+.reordering .menu-item .item-controls,
+.reordering .menu-item .item-type {
+ display: none;
+}
+
+.reordering .menu-item-reorder-nav {
+ display: block;
+}
+
+.customize-control input.menu-name-field {
+ width: 100%; /* Override the 98% default for customizer inputs, to align with the size of menu items. */
+ margin: 12px 0;
+}
+
+.wp-customizer .menu-item .item-edit {
+ position: absolute;
+ left: -19px;
+ top: 2px;
+ display: block;
+ width: 30px;
+ height: 38px;
+ margin-left: 0 !important;
+ text-indent: 100%;
+ outline: none;
+ overflow: hidden;
+ white-space: nowrap;
+ cursor: pointer;
+}
+
+.customize-control-nav_menu_item .item-edit:focus {
+ color: #0073aa;
+ -webkit-box-shadow: 0 0 0 1px #5b9dd9, 0 0 2px 1px rgba(30, 140, 190, .8);
+ box-shadow: 0 0 0 1px #5b9dd9, 0 0 2px 1px rgba(30, 140, 190, .8);
+}
+
+/* Duplicates `.nav-menus-php .item-edit:before {}` in common.css:2220. */
+.wp-customizer .menu-item .item-edit:before {
+ top: -1px;
+ left: 0;
+ content: '\f140';
+ border: none;
+ background: none;
+ font: normal 20px/1 dashicons;
+ speak: none;
+ display: block;
+ padding: 0;
+ text-indent: 0;
+ text-align: center;
+ position: relative;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+ text-decoration: none !important;
+}
+
+.wp-customizer .menu-item.menu-item-edit-active .item-edit:before {
+ content: '\f142';
+}
+
+.wp-customizer .menu-item .item-edit:before {
+ line-height: 2;
+}
+
+/* Duplicates `.nav-menus-php .menu-item-edit-active .item-edit:before {}` in common.css:2271. */
+.wp-customizer .menu-item .menu-item-edit-active .item-edit:before {
+ content: '\f142';
+}
+
+.wp-customizer .menu-item-settings p.description {
+ font-style: normal;
+}
+
+.wp-customizer .menu-settings dl {
+ margin: 12px 0 0 0;
+ padding: 0;
+}
+
+.wp-customizer .menu-settings .checkbox-input {
+ margin-top: 8px;
+}
+
+.wp-customizer .menu-settings .menu-theme-locations {
+ border-top: 1px solid #ccc;
+}
+
+.wp-customizer .menu-settings {
+ margin-top: 36px;
+ border-top: none;
+}
+
+.menu-settings .customize-control-checkbox label {
+ line-height: 1;
+}
+
+/* @todo update selector or potentially remove */
+.menu-settings .customize-control.customize-control-checkbox {
+ margin-bottom: 8px; /* Override collapsing at smaller viewports. */
+}
+
+.customize-control-menu {
+ margin-top: 4px;
+}
+
+#customize-controls .customize-info.open.active-menu-screen-options .customize-help-toggle {
+ color: #555;
+}
+
+/* Screen Options */
+.customize-screen-options-toggle {
+ background: none;
+ border: none;
+ color: #555;
+ cursor: pointer;
+ padding: 20px;
+ position: absolute;
+ left: 31px;
+ top: 4px;
+}
+
+#customize-controls .customize-info .customize-help-toggle {
+ padding: 20px;
+}
+
+#customize-controls .customize-info .customize-help-toggle:before {
+ padding: 5px;
+}
+
+.customize-screen-options-toggle:hover,
+.customize-screen-options-toggle:active,
+.customize-screen-options-toggle:focus,
+.active-menu-screen-options .customize-screen-options-toggle,
+#customize-controls .customize-info.open.active-menu-screen-options .customize-help-toggle:hover,
+#customize-controls .customize-info.open.active-menu-screen-options .customize-help-toggle:active,
+#customize-controls .customize-info.open.active-menu-screen-options .customize-help-toggle:focus {
+ color: #0073aa;
+}
+
+.customize-screen-options-toggle:focus,
+#customize-controls .customize-info .customize-help-toggle:focus {
+ outline: none;
+ -webkit-box-shadow: 0 0 0 1px #5b9dd9, 0 0 2px 1px rgba(30, 140, 190, .8);
+ box-shadow: 0 0 0 1px #5b9dd9, 0 0 2px 1px rgba(30, 140, 190, .8);
+}
+
+.customize-screen-options-toggle:before {
+ -moz-osx-font-smoothing: grayscale;
+ border: none;
+ content: "\f111";
+ display: block;
+ font: 20px/1 "dashicons";
+ padding: 5px;
+ text-align: center;
+ text-decoration: none !important;
+ text-indent: 0;
+ right: 5px;
+ position: absolute;
+ top: 5px;
+}
+
+.wp-customizer #screen-options-wrap {
+ display: none;
+ background: #fff;
+ border-top: 1px solid #ddd;
+ padding: 4px 15px 0;
+}
+
+.wp-customizer .metabox-prefs label {
+ display: block;
+ padding-left: 0;
+ line-height: 30px;
+}
+
+#accordion-panel-menus .field-link-target,
+#accordion-panel-menus .field-attr-title,
+#accordion-panel-menus .field-css-classes,
+#accordion-panel-menus .field-xfn,
+#accordion-panel-menus .field-description {
+ display: none;
+}
+
+#accordion-panel-menus.field-link-target-active .field-link-target,
+#accordion-panel-menus.field-attr-title-active .field-attr-title,
+#accordion-panel-menus.field-css-classes-active .field-css-classes,
+#accordion-panel-menus.field-xfn-active .field-xfn,
+#accordion-panel-menus.field-description-active .field-description {
+ display: block;
+}
+
+
+/* Not exactly sure what broke this, or why it works without these styles in core. */
+.wp-customizer .wp-full-overlay a.collapse-sidebar {
+ position: fixed;
+ right: 0;
+}
+
+/* WARNING: The 20px factor is hard-coded in JS. */
+.menu-item-depth-0 { margin-right: 0; }
+.menu-item-depth-1 { margin-right: 20px; }
+.menu-item-depth-2 { margin-right: 40px; }
+.menu-item-depth-3 { margin-right: 60px; }
+.menu-item-depth-4 { margin-right: 80px; }
+.menu-item-depth-5 { margin-right: 100px; }
+.menu-item-depth-6 { margin-right: 120px; }
+.menu-item-depth-7 { margin-right: 140px; }
+.menu-item-depth-8 { margin-right: 160px; } /* Not likely to be used or useful beyond this depth */
+.menu-item-depth-9 { margin-right: 180px; }
+.menu-item-depth-10 { margin-right: 200px; }
+.menu-item-depth-11 { margin-right: 220px; }
+
+/* @todo handle .menu-item-settings width */
+.menu-item-depth-0 > .menu-item-bar { margin-left: 0; }
+.menu-item-depth-1 > .menu-item-bar { margin-left: 20px; }
+.menu-item-depth-2 > .menu-item-bar { margin-left: 40px; }
+.menu-item-depth-3 > .menu-item-bar { margin-left: 60px; }
+.menu-item-depth-4 > .menu-item-bar { margin-left: 80px; }
+.menu-item-depth-5 > .menu-item-bar { margin-left: 100px; }
+.menu-item-depth-6 > .menu-item-bar { margin-left: 120px; }
+.menu-item-depth-7 > .menu-item-bar { margin-left: 140px; }
+.menu-item-depth-8 > .menu-item-bar { margin-left: 160px; }
+.menu-item-depth-9 > .menu-item-bar { margin-left: 180px; }
+.menu-item-depth-10 > .menu-item-bar { margin-left: 200px; }
+.menu-item-depth-11 > .menu-item-bar { margin-left: 220px; }
+
+/* Submenu left margin. */
+/* @todo menu-item-transport seems entirely unused. */
+.menu-item-depth-0 .menu-item-transport { margin-right: 0; }
+.menu-item-depth-1 .menu-item-transport { margin-right: -20px; }
+.menu-item-depth-3 .menu-item-transport { margin-right: -60px; }
+.menu-item-depth-4 .menu-item-transport { margin-right: -80px; }
+.menu-item-depth-2 .menu-item-transport { margin-right: -40px; }
+.menu-item-depth-5 .menu-item-transport { margin-right: -100px; }
+.menu-item-depth-6 .menu-item-transport { margin-right: -120px; }
+.menu-item-depth-7 .menu-item-transport { margin-right: -140px; }
+.menu-item-depth-8 .menu-item-transport { margin-right: -160px; }
+.menu-item-depth-9 .menu-item-transport { margin-right: -180px; }
+.menu-item-depth-10 .menu-item-transport { margin-right: -200px; }
+.menu-item-depth-11 .menu-item-transport { margin-right: -220px; }
+
+/* WARNING: The 20px factor is hard-coded in JS. */
+.reordering .menu-item-depth-0 { margin-right: 0; }
+.reordering .menu-item-depth-1 { margin-right: 15px; }
+.reordering .menu-item-depth-2 { margin-right: 30px; }
+.reordering .menu-item-depth-3 { margin-right: 45px; }
+.reordering .menu-item-depth-4 { margin-right: 60px; }
+.reordering .menu-item-depth-5 { margin-right: 75px; }
+.reordering .menu-item-depth-6 { margin-right: 90px; }
+.reordering .menu-item-depth-7 { margin-right: 105px; }
+.reordering .menu-item-depth-8 { margin-right: 120px; } /* Not likely to be used or useful beyond this depth */
+.reordering .menu-item-depth-9 { margin-right: 135px; }
+.reordering .menu-item-depth-10 { margin-right: 150px; }
+.reordering .menu-item-depth-11 { margin-right: 165px; }
+
+.reordering .menu-item-depth-0 > .menu-item-bar { margin-left: 0; }
+.reordering .menu-item-depth-1 > .menu-item-bar { margin-left: 15px; }
+.reordering .menu-item-depth-2 > .menu-item-bar { margin-left: 30px; }
+.reordering .menu-item-depth-3 > .menu-item-bar { margin-left: 45px; }
+.reordering .menu-item-depth-4 > .menu-item-bar { margin-left: 60px; }
+.reordering .menu-item-depth-5 > .menu-item-bar { margin-left: 75px; }
+.reordering .menu-item-depth-6 > .menu-item-bar { margin-left: 90px; }
+.reordering .menu-item-depth-7 > .menu-item-bar { margin-left: 105px; }
+.reordering .menu-item-depth-8 > .menu-item-bar { margin-left: 120px; }
+.reordering .menu-item-depth-9 > .menu-item-bar { margin-left: 135px; }
+.reordering .menu-item-depth-10 > .menu-item-bar { margin-left: 150px; }
+.reordering .menu-item-depth-11 > .menu-item-bar { margin-left: 165px; }
+
+.control-section-nav_menu .menu .menu-item-edit-active {
+ margin-right: 0;
+}
+
+.control-section-nav_menu .menu .menu-item-edit-active .menu-item-bar {
+ margin-left: 0;
+}
+
+.control-section-nav_menu .menu .sortable-placeholder {
+ margin-top: 0;
+ margin-bottom: 1px;
+ max-width: -webkit-calc(100% - 2px);
+ max-width: calc(100% - 2px);
+ float: right;
+ display: list-item;
+ border-color: #a0a5aa;
+}
+
+.control-section-nav_menu .menu ul.menu-item-transport dl {
+ margin-top: 0;
+}
+
+/*
+ * Add-menu-items mode.
+ */
+.wp-full-overlay-main {
+ left: auto; /* This overrides a right: 0; which causes the preview to resize rather than slide off screen at the normal size. */
+ width: 100%;
+}
+
+.adding-menu-items .control-section {
+ opacity: .4;
+}
+
+.adding-menu-items .control-panel.control-section,
+.adding-menu-items .control-section.open {
+ opacity: 1;
+}
+
+/* Add-new button. */
+#customize-theme-controls .add-new-menu-item {
+ cursor: pointer;
+ float: left;
+ margin-right: 10px;
+ -webkit-transition: all 0.2s;
+ transition: all 0.2s;
+ -webkit-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
+ outline: none;
+}
+
+.add-new-menu-item:before {
+ content: "\f132";
+ display: inline-block;
+ position: relative;
+ right: -2px;
+ top: -1px;
+ font: normal 20px/1 'dashicons';
+ vertical-align: middle;
+ -webkit-transition: all 0.2s;
+ transition: all 0.2s;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+}
+
+.adding-menu-items .add-new-menu-item,
+.adding-menu-items .add-new-menu-item:hover,
+.add-menu-toggle.open,
+.add-menu-toggle.open:hover {
+ background: #eee;
+ border-color: #929793;
+ color: #32373c;
+ -webkit-box-shadow: inset 0 2px 5px -3px rgba(0, 0, 0, 0.5);
+ box-shadow: inset 0 2px 5px -3px rgba(0, 0, 0, 0.5);
+}
+
+.adding-menu-items .add-new-menu-item:before,
+#accordion-section-add_menu .add-new-menu-item.open:before {
+ -webkit-transform: rotate(-45deg);
+ -ms-transform: rotate(-45deg);
+ transform: rotate(-45deg);
+}
+
+.menu-item-bar .item-delete {
+ color: #a00;
+ position: absolute;
+ top: 2px;
+ left: -19px;
+ width: 30px;
+ height: 38px;
+ cursor: pointer;
+ display: none;
+}
+
+.menu-item-bar .item-delete:before {
+ content: "\f335";
+ font: normal 20px/1 dashicons;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+ position: absolute;
+ top: 9px;
+ right: 5px;
+}
+
+.menu-item-bar .item-delete:hover,
+.menu-item-bar .item-delete:focus {
+ color: #f00;
+}
+
+.adding-menu-items .menu-item-bar .item-edit {
+ display: none;
+}
+
+.adding-menu-items .menu-item-bar .item-delete {
+ display: block;
+}
+
+#available-menu-items .item {
+ position: static;
+}
+
+#available-menu-items {
+ position: absolute;
+ overflow: hidden;
+ top: 0;
+ bottom: 0;
+ right: -301px;
+ width: 300px;
+ margin: 0;
+ z-index: 4;
+ background: #eee;
+ -webkit-transition: all 0.2s;
+ transition: all 0.2s;
+ border-left: 1px solid #ddd;
+}
+
+#available-menu-items.allow-scroll {
+ overflow-y: auto;
+}
+
+#available-menu-items .accordion-section-title {
+ border-right: none;
+ border-left: none;
+ background: #fff;
+}
+
+#available-menu-items .open .accordion-section-title {
+ background: #eee;
+}
+
+#available-menu-items .open .accordion-section-title:after {
+ content: '\f142';
+}
+
+#available-menu-items .accordion-section-content {
+ overflow-y: auto;
+ max-height: 200px; /* This gets set in JS to fit the screen size, and based on # of sections. */
+ background: transparent;
+}
+
+button.not-a-button {
+ background: transparent;
+ border: none;
+ -webkit-box-shadow: none;
+ box-shadow: none;
+ -webkit-border-radius: 0;
+ border-radius: 0;
+ outline: 0;
+ padding: 0;
+ margin: 0;
+}
+
+#available-menu-items .accordion-section-title button:focus:before {
+ display: block;
+ content: "";
+ width: 28px;
+ height: 32px;
+ position: absolute;
+ left: 5px;
+ top: 5px;
+ -webkit-box-shadow: 0 0 0 1px #5b9dd9, 0 0 2px 1px rgba(30, 140, 190, .8);
+ box-shadow: 0 0 0 1px #5b9dd9, 0 0 2px 1px rgba(30, 140, 190, .8);
+}
+
+#available-menu-items .accordion-section-content {
+ padding: 1px 15px 15px 15px;
+ min-height: 120px;
+ max-height: 290px;
+}
+
+#custom-menu-item-name.invalid,
+#custom-menu-item-url.invalid {
+ border: 1px solid #f00;
+}
+
+#available-menu-items .item-tpl {
+ position: relative;
+ padding: 20px 60px 20px 15px;
+ border-bottom: 1px solid #e4e4e4;
+ cursor: pointer;
+ display: none;
+}
+
+#available-menu-items .item-tpl:hover,
+#available-menu-items .item-tpl.selected {
+ background: #eee;
+}
+
+#available-menu-items .menu-item-handle .item-type {
+ padding-left: 0;
+}
+
+#available-menu-items .menu-item-handle .item-title {
+ padding-right: 20px;
+}
+
+#available-menu-items .menu-item-handle {
+ cursor: pointer;
+}
+
+#available-menu-items .item-top,
+#available-menu-items .item-top:hover {
+ border: none;
+ background: transparent;
+ -webkit-box-shadow: none;
+ box-shadow: none;
+}
+
+#available-menu-items .menu-item-handle {
+ -webkit-box-shadow: none;
+ box-shadow: none;
+ margin-top: -1px;
+}
+
+#available-menu-items .menu-item-handle:hover {
+ z-index: 1;
+}
+
+#available-menu-items .item-title h4 {
+ padding: 0 0 5px;
+ font-size: 14px;
+}
+
+#available-menu-items .item-add {
+ position: absolute;
+ top: 1px;
+ right: 1px;
+ color: #82878c;
+ width: 30px;
+ height: 38px;
+ cursor: pointer;
+}
+
+#available-menu-items .menu-item-handle .item-add:focus {
+ color: #23282d;
+ -webkit-box-shadow: 0 0 0 1px #5b9dd9, 0 0 2px 1px rgba(30, 140, 190, .8);
+ box-shadow: 0 0 0 1px #5b9dd9, 0 0 2px 1px rgba(30, 140, 190, .8);
+}
+
+#available-menu-items .item-add:before {
+ content: "\f132";
+ font: normal 20px/1 dashicons;
+ position: relative;
+ right: 2px;
+ top: 4px;
+}
+
+#available-menu-items .menu-item-handle.item-added .item-type,
+#available-menu-items .menu-item-handle.item-added .item-title,
+#available-menu-items .menu-item-handle.item-added:hover .item-add,
+#available-menu-items .menu-item-handle.item-added .item-add:focus {
+ color: #82878c;
+}
+
+#available-menu-items .menu-item-handle.item-added .item-add:before {
+ content: "\f147";
+}
+
+#available-menu-items .accordion-section-title.loading .spinner,
+#available-menu-items-search.loading .accordion-section-title .spinner {
+ visibility: visible;
+ margin: 0 20px;
+}
+
+#available-menu-items-search .spinner {
+ position: absolute;
+ top: 18px;
+ margin: 0 !important;
+ left: 20px;
+}
+
+#available-menu-items-search input {
+ padding: 6px 10px;
+ width: 100%;
+}
+
+#available-menu-items-search .accordion-section-title {
+ padding: 12px 15px;
+ -webkit-box-sizing: border-box;
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+}
+
+#available-menu-items-search .accordion-section-title:after {
+ display: none;
+}
+
+#available-menu-items-search .accordion-section-content:empty {
+ min-height: 0;
+ padding: 0;
+}
+
+#available-menu-items-search.loading .accordion-section-content div {
+ opacity: .5;
+}
+
+#available-menu-items-search.loading.loading-more .accordion-section-content div {
+ opacity: 1;
+}
+
+#customize-preview {
+ -webkit-transition: all 0.2s;
+ transition: all 0.2s;
+}
+
+body.adding-menu-items #available-menu-items {
+ right: 0;
+}
+
+body.adding-menu-items .wp-full-overlay-main {
+ right: 300px;
+}
+
+body.adding-menu-items #customize-preview {
+ opacity: 0.4;
+}
+
+.menu-item-handle .spinner {
+ display: none;
+ float: right;
+ margin: 0 0 0 8px;
+}
+
+.nav-menu-inserted-item-loading .spinner {
+ display: block;
+}
+
+.nav-menu-inserted-item-loading .menu-item-handle .item-type {
+ padding: 0 8px 0 0;
+}
+
+.nav-menu-inserted-item-loading .menu-item-handle,
+.added-menu-item .menu-item-handle.loading {
+ padding: 10px 8px 10px 15px;
+ cursor: default;
+ opacity: .5;
+ background: #fff;
+ color: #727773;
+}
+
+.added-menu-item .menu-item-handle {
+ -webkit-transition-property: opacity, background, color;
+ transition-property: opacity, background, color;
+ -webkit-transition-duration: 1.25s;
+ transition-duration: 1.25s;
+ -webkit-transition-timing-function: cubic-bezier( .25, -2.5, .75, 8 );
+ transition-timing-function: cubic-bezier( .25, -2.5, .75, 8 ); /* Replacement for .hide().fadeIn('slow') in JS to add emphasis when it's loaded. */
+}
+
+/* Add/delete Menus */
+
+/* @todo update selector */
+#accordion-section-add_menu {
+ margin: 15px 12px;
+}
+
+.new-menu-section-content {
+ display: none;
+ padding: 15px 0 0 0;
+ overflow: hidden;
+ clear: both;
+}
+
+/* @todo update selector */
+#accordion-section-add_menu .accordion-section-title {
+ padding-right: 45px;
+}
+
+/* @todo update selector */
+#accordion-section-add_menu .accordion-section-title:before {
+ font: normal 20px/1 dashicons;
+ position: absolute;
+ top: 12px;
+ right: 14px;
+ content: "\f132";
+}
+
+#create-new-menu-submit {
+ float: left;
+ margin: 0 0 12px 0;
+}
+
+.menu-delete-item {
+ display: block;
+ float: right;
+ padding: 1em 0;
+ width: 100%;
+}
+
+li.assigned-to-menu-location .menu-delete-item {
+ display: none;
+}
+
+li.assigned-to-menu-location .add-new-menu-item {
+ margin-bottom: 1em;
+}
+
+.menu-delete {
+ color: #a00;
+ cursor: pointer;
+ text-decoration: underline;
+}
+
+.menu-delete:hover,
+.menu-delete:focus {
+ color: #f00;
+ text-decoration: none;
+}
+
+.menu-delete:focus {
+ -webkit-box-shadow: 0 0 0 1px #5b9dd9, 0 0 2px 1px rgba(30, 140, 190, .8);
+ box-shadow: 0 0 0 1px #5b9dd9, 0 0 2px 1px rgba(30, 140, 190, .8);
+}
+
+.menu-item-handle {
+ margin-top: -1px;
+}
+.ui-sortable-disabled .menu-item-handle {
+ cursor: default;
+}
+
+.menu-item-handle:hover {
+ position: relative;
+ z-index: 10;
+ color: #0073aa;
+}
+
+.menu-item-handle:hover .item-type,
+.menu-item-handle:hover .item-edit,
+#available-menu-items .menu-item-handle:hover .item-add {
+ color: #0073aa;
+}
+
+.menu-item-edit-active .menu-item-handle {
+ border-color: #999;
+ border-bottom: none;
+}
+
+.customize-control-nav_menu_item {
+ margin-bottom: 0;
+}
+
+.customize-control-nav_menu {
+ margin-top: 12px;
+}
+
+#available-menu-items .customize-section-title {
+ display: none;
+}
+
+@media screen and ( max-width: 640px ) {
+ body.adding-menu-items div#available-menu-items {
+ top: 46px;
+ right: 0;
+ z-index: 10;
+ width: 100%;
+ }
+
+ #available-menu-items .customize-section-title {
+ display: block;
+ margin: 0;
+ }
+
+ #available-menu-items .customize-section-back {
+ height: 69px;
+ }
+
+ #available-menu-items .customize-section-title h3 {
+ font-size: 20px;
+ font-weight: 200;
+ padding: 9px 14px 12px 10px;
+ margin: 0;
+ line-height: 24px;
+ color: #555;
+ display: block;
+ overflow: hidden;
+ white-space: nowrap;
+ text-overflow: ellipsis;
+ }
+
+ #available-menu-items .customize-section-title .customize-action {
+ font-size: 13px;
+ display: block;
+ font-weight: 400;
+ overflow: hidden;
+ white-space: nowrap;
+ text-overflow: ellipsis;
+ }
+}
diff --git a/wp-admin/css/customize-nav-menus-rtl.min.css b/wp-admin/css/customize-nav-menus-rtl.min.css
new file mode 100644
index 0000000000..376efffaaa
--- /dev/null
+++ b/wp-admin/css/customize-nav-menus-rtl.min.css
@@ -0,0 +1 @@
+#accordion-section-menu_locations{position:relative;margin-bottom:15px}.menu-in-location,.menu-in-locations{display:block;color:#999;font-weight:600;font-size:10px}#customize-controls .control-section .accordion-section-title:focus .menu-in-location,#customize-controls .control-section .accordion-section-title:focus .menu-in-locations,#customize-controls .control-section .accordion-section-title:hover .menu-in-location,#customize-controls .control-section .accordion-section-title:hover .menu-in-locations{color:#fff}.wp-customizer .menu-item-bar .menu-item-handle,.wp-customizer .menu-item-settings,.wp-customizer .menu-item-settings .description-thin{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.wp-customizer .menu-item-bar{margin:0}.wp-customizer .menu-item-bar .menu-item-handle{max-width:100%;background:#fff}.wp-customizer .menu-item-handle .item-title{margin-left:0}.wp-customizer .menu-item-handle .item-type{padding:1px 5px 0 15px;float:left;text-align:left}.wp-customizer .menu-item-settings{max-width:100%;overflow:hidden;padding:10px;background:#eee;border:1px solid #999;border-top:none}.wp-customizer .menu-item-settings .description-thin{width:100%;height:auto;margin:0 0 8px}.wp-customizer .menu-item-settings input[type=text]{width:100%}.wp-customizer .menu-item-settings .submitbox{margin:0;padding:0}.wp-customizer .menu-item-settings .link-to-original{padding:5px 0;border:none;font-style:normal;margin:0;width:100%}.wp-customizer .menu-item .submitbox .submitdelete{display:block;float:right;margin:6px 0 0;padding:0;cursor:pointer}.wp-customizer .menu-item .submitbox .submitdelete:focus{-webkit-box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8);box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8)}#customize-theme-controls button.reorder-toggle{padding:5px 8px}.menu-item-reorder-nav{display:none;background-color:#fff;position:absolute;top:0;left:0}#customize-theme-controls .reordering .add-new-menu-item{opacity:.2;pointer-events:none;cursor:not-allowed}.menu-item-reorder-nav button{position:relative;overflow:hidden;float:right;display:block;width:30px;height:40px;color:#82878c;text-indent:-9999px;cursor:pointer;background:0 0;border:none;-webkit-box-shadow:none;box-shadow:none;outline:0}.menu-item-reorder-nav button:before{display:inline-block;position:absolute;top:0;left:0;width:100%;height:100%;font:400 20px/40px dashicons;text-align:center;text-indent:0;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.menu-item-reorder-nav button:focus,.menu-item-reorder-nav button:hover{color:#191e23;background:#eee}.menus-move-down:before{content:'\f347'}.menus-move-up:before{content:'\f343'}.menus-move-left:before{content:'\f341'}.menus-move-right:before{content:'\f345'}.menu-item-depth-0 .menus-move-left,.menu-item-depth-10 .menus-move-right,.move-down-disabled .menus-move-down,.move-left-disabled .menus-move-left,.move-right-disabled .menus-move-right,.move-up-disabled .menus-move-up{color:#d5d5d5!important;background-color:#fff!important;cursor:default;pointer-events:none}.menu-item-reorder-nav:before{content:"";display:block;position:absolute;right:-10px;width:10px;height:40px;background:-webkit-gradient(linear,right top,left top,from(rgba(250,250,250,0)),to(rgba(250,250,250,1)));background:-webkit-linear-gradient(right,rgba(250,250,250,0) 0,rgba(250,250,250,1) 100%);background:linear-gradient(to left,rgba(250,250,250,0) 0,rgba(250,250,250,1) 100%)}.reordering .menu-item .item-controls,.reordering .menu-item .item-type{display:none}.reordering .menu-item-reorder-nav{display:block}.customize-control input.menu-name-field{width:100%;margin:12px 0}.wp-customizer .menu-item .item-edit{position:absolute;left:-19px;top:2px;display:block;width:30px;height:38px;margin-left:0!important;text-indent:100%;outline:0;overflow:hidden;white-space:nowrap;cursor:pointer}.customize-control-nav_menu_item .item-edit:focus{color:#0073aa;-webkit-box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8);box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8)}.wp-customizer .menu-item .item-edit:before{top:-1px;left:0;content:'\f140';border:none;background:0 0;font:400 20px/1 dashicons;speak:none;display:block;padding:0;text-indent:0;text-align:center;position:relative;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-decoration:none!important}.wp-customizer .menu-item.menu-item-edit-active .item-edit:before{content:'\f142'}.wp-customizer .menu-item .item-edit:before{line-height:2}.wp-customizer .menu-item .menu-item-edit-active .item-edit:before{content:'\f142'}.wp-customizer .menu-item-settings p.description{font-style:normal}.wp-customizer .menu-settings dl{margin:12px 0 0;padding:0}.wp-customizer .menu-settings .checkbox-input{margin-top:8px}.wp-customizer .menu-settings .menu-theme-locations{border-top:1px solid #ccc}.wp-customizer .menu-settings{margin-top:36px;border-top:none}.menu-settings .customize-control-checkbox label{line-height:1}.menu-settings .customize-control.customize-control-checkbox{margin-bottom:8px}.customize-control-menu{margin-top:4px}#customize-controls .customize-info.open.active-menu-screen-options .customize-help-toggle{color:#555}.customize-screen-options-toggle{background:0 0;border:none;color:#555;cursor:pointer;padding:20px;position:absolute;left:31px;top:4px}#customize-controls .customize-info .customize-help-toggle{padding:20px}#customize-controls .customize-info .customize-help-toggle:before{padding:5px}#customize-controls .customize-info.open.active-menu-screen-options .customize-help-toggle:active,#customize-controls .customize-info.open.active-menu-screen-options .customize-help-toggle:focus,#customize-controls .customize-info.open.active-menu-screen-options .customize-help-toggle:hover,.active-menu-screen-options .customize-screen-options-toggle,.customize-screen-options-toggle:active,.customize-screen-options-toggle:focus,.customize-screen-options-toggle:hover{color:#0073aa}#customize-controls .customize-info .customize-help-toggle:focus,.customize-screen-options-toggle:focus{outline:0;-webkit-box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8);box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8)}.customize-screen-options-toggle:before{-moz-osx-font-smoothing:grayscale;border:none;content:"\f111";display:block;font:20px/1 dashicons;padding:5px;text-align:center;text-decoration:none!important;text-indent:0;right:5px;position:absolute;top:5px}.wp-customizer #screen-options-wrap{display:none;background:#fff;border-top:1px solid #ddd;padding:4px 15px 0}.wp-customizer .metabox-prefs label{display:block;padding-left:0;line-height:30px}#accordion-panel-menus .field-attr-title,#accordion-panel-menus .field-css-classes,#accordion-panel-menus .field-description,#accordion-panel-menus .field-link-target,#accordion-panel-menus .field-xfn{display:none}#accordion-panel-menus.field-attr-title-active .field-attr-title,#accordion-panel-menus.field-css-classes-active .field-css-classes,#accordion-panel-menus.field-description-active .field-description,#accordion-panel-menus.field-link-target-active .field-link-target,#accordion-panel-menus.field-xfn-active .field-xfn{display:block}.wp-customizer .wp-full-overlay a.collapse-sidebar{position:fixed;right:0}.menu-item-depth-0{margin-right:0}.menu-item-depth-1{margin-right:20px}.menu-item-depth-2{margin-right:40px}.menu-item-depth-3{margin-right:60px}.menu-item-depth-4{margin-right:80px}.menu-item-depth-5{margin-right:100px}.menu-item-depth-6{margin-right:120px}.menu-item-depth-7{margin-right:140px}.menu-item-depth-8{margin-right:160px}.menu-item-depth-9{margin-right:180px}.menu-item-depth-10{margin-right:200px}.menu-item-depth-11{margin-right:220px}.menu-item-depth-0>.menu-item-bar{margin-left:0}.menu-item-depth-1>.menu-item-bar{margin-left:20px}.menu-item-depth-2>.menu-item-bar{margin-left:40px}.menu-item-depth-3>.menu-item-bar{margin-left:60px}.menu-item-depth-4>.menu-item-bar{margin-left:80px}.menu-item-depth-5>.menu-item-bar{margin-left:100px}.menu-item-depth-6>.menu-item-bar{margin-left:120px}.menu-item-depth-7>.menu-item-bar{margin-left:140px}.menu-item-depth-8>.menu-item-bar{margin-left:160px}.menu-item-depth-9>.menu-item-bar{margin-left:180px}.menu-item-depth-10>.menu-item-bar{margin-left:200px}.menu-item-depth-11>.menu-item-bar{margin-left:220px}.menu-item-depth-0 .menu-item-transport{margin-right:0}.menu-item-depth-1 .menu-item-transport{margin-right:-20px}.menu-item-depth-3 .menu-item-transport{margin-right:-60px}.menu-item-depth-4 .menu-item-transport{margin-right:-80px}.menu-item-depth-2 .menu-item-transport{margin-right:-40px}.menu-item-depth-5 .menu-item-transport{margin-right:-100px}.menu-item-depth-6 .menu-item-transport{margin-right:-120px}.menu-item-depth-7 .menu-item-transport{margin-right:-140px}.menu-item-depth-8 .menu-item-transport{margin-right:-160px}.menu-item-depth-9 .menu-item-transport{margin-right:-180px}.menu-item-depth-10 .menu-item-transport{margin-right:-200px}.menu-item-depth-11 .menu-item-transport{margin-right:-220px}.reordering .menu-item-depth-0{margin-right:0}.reordering .menu-item-depth-1{margin-right:15px}.reordering .menu-item-depth-2{margin-right:30px}.reordering .menu-item-depth-3{margin-right:45px}.reordering .menu-item-depth-4{margin-right:60px}.reordering .menu-item-depth-5{margin-right:75px}.reordering .menu-item-depth-6{margin-right:90px}.reordering .menu-item-depth-7{margin-right:105px}.reordering .menu-item-depth-8{margin-right:120px}.reordering .menu-item-depth-9{margin-right:135px}.reordering .menu-item-depth-10{margin-right:150px}.reordering .menu-item-depth-11{margin-right:165px}.reordering .menu-item-depth-0>.menu-item-bar{margin-left:0}.reordering .menu-item-depth-1>.menu-item-bar{margin-left:15px}.reordering .menu-item-depth-2>.menu-item-bar{margin-left:30px}.reordering .menu-item-depth-3>.menu-item-bar{margin-left:45px}.reordering .menu-item-depth-4>.menu-item-bar{margin-left:60px}.reordering .menu-item-depth-5>.menu-item-bar{margin-left:75px}.reordering .menu-item-depth-6>.menu-item-bar{margin-left:90px}.reordering .menu-item-depth-7>.menu-item-bar{margin-left:105px}.reordering .menu-item-depth-8>.menu-item-bar{margin-left:120px}.reordering .menu-item-depth-9>.menu-item-bar{margin-left:135px}.reordering .menu-item-depth-10>.menu-item-bar{margin-left:150px}.reordering .menu-item-depth-11>.menu-item-bar{margin-left:165px}.control-section-nav_menu .menu .menu-item-edit-active{margin-right:0}.control-section-nav_menu .menu .menu-item-edit-active .menu-item-bar{margin-left:0}.control-section-nav_menu .menu .sortable-placeholder{margin-top:0;margin-bottom:1px;max-width:-webkit-calc(100% - 2px);max-width:calc(100% - 2px);float:right;display:list-item;border-color:#a0a5aa}.control-section-nav_menu .menu ul.menu-item-transport dl{margin-top:0}.wp-full-overlay-main{left:auto;width:100%}.adding-menu-items .control-section{opacity:.4}.adding-menu-items .control-panel.control-section,.adding-menu-items .control-section.open{opacity:1}#customize-theme-controls .add-new-menu-item{cursor:pointer;float:left;margin-right:10px;-webkit-transition:all .2s;transition:all .2s;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;outline:0}.add-new-menu-item:before{content:"\f132";display:inline-block;position:relative;right:-2px;top:-1px;font:400 20px/1 dashicons;vertical-align:middle;-webkit-transition:all .2s;transition:all .2s;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.add-menu-toggle.open,.add-menu-toggle.open:hover,.adding-menu-items .add-new-menu-item,.adding-menu-items .add-new-menu-item:hover{background:#eee;border-color:#929793;color:#32373c;-webkit-box-shadow:inset 0 2px 5px -3px rgba(0,0,0,.5);box-shadow:inset 0 2px 5px -3px rgba(0,0,0,.5)}#accordion-section-add_menu .add-new-menu-item.open:before,.adding-menu-items .add-new-menu-item:before{-webkit-transform:rotate(-45deg);-ms-transform:rotate(-45deg);transform:rotate(-45deg)}.menu-item-bar .item-delete{color:#a00;position:absolute;top:2px;left:-19px;width:30px;height:38px;cursor:pointer;display:none}.menu-item-bar .item-delete:before{content:"\f335";font:400 20px/1 dashicons;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;position:absolute;top:9px;right:5px}.menu-item-bar .item-delete:focus,.menu-item-bar .item-delete:hover{color:red}.adding-menu-items .menu-item-bar .item-edit{display:none}.adding-menu-items .menu-item-bar .item-delete{display:block}#available-menu-items .item{position:static}#available-menu-items{position:absolute;overflow:hidden;top:0;bottom:0;right:-301px;width:300px;margin:0;z-index:4;background:#eee;-webkit-transition:all .2s;transition:all .2s;border-left:1px solid #ddd}#available-menu-items.allow-scroll{overflow-y:auto}#available-menu-items .accordion-section-title{border-right:none;border-left:none;background:#fff}#available-menu-items .open .accordion-section-title{background:#eee}#available-menu-items .open .accordion-section-title:after{content:'\f142'}#available-menu-items .accordion-section-content{overflow-y:auto;background:0 0}button.not-a-button{background:0 0;border:none;-webkit-box-shadow:none;box-shadow:none;-webkit-border-radius:0;border-radius:0;outline:0;padding:0;margin:0}#available-menu-items .accordion-section-title button:focus:before{display:block;content:"";width:28px;height:32px;position:absolute;left:5px;top:5px;-webkit-box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8);box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8)}#available-menu-items .accordion-section-content{padding:1px 15px 15px;min-height:120px;max-height:290px}#custom-menu-item-name.invalid,#custom-menu-item-url.invalid{border:1px solid red}#available-menu-items .item-tpl{position:relative;padding:20px 60px 20px 15px;border-bottom:1px solid #e4e4e4;cursor:pointer;display:none}#available-menu-items .item-tpl.selected,#available-menu-items .item-tpl:hover{background:#eee}#available-menu-items .menu-item-handle .item-type{padding-left:0}#available-menu-items .menu-item-handle .item-title{padding-right:20px}#available-menu-items .menu-item-handle{cursor:pointer}#available-menu-items .item-top,#available-menu-items .item-top:hover{border:none;background:0 0;-webkit-box-shadow:none;box-shadow:none}#available-menu-items .menu-item-handle{-webkit-box-shadow:none;box-shadow:none;margin-top:-1px}#available-menu-items .menu-item-handle:hover{z-index:1}#available-menu-items .item-title h4{padding:0 0 5px;font-size:14px}#available-menu-items .item-add{position:absolute;top:1px;right:1px;color:#82878c;width:30px;height:38px;cursor:pointer}#available-menu-items .menu-item-handle .item-add:focus{color:#23282d;-webkit-box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8);box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8)}#available-menu-items .item-add:before{content:"\f132";font:400 20px/1 dashicons;position:relative;right:2px;top:4px}#available-menu-items .menu-item-handle.item-added .item-add:focus,#available-menu-items .menu-item-handle.item-added .item-title,#available-menu-items .menu-item-handle.item-added .item-type,#available-menu-items .menu-item-handle.item-added:hover .item-add{color:#82878c}#available-menu-items .menu-item-handle.item-added .item-add:before{content:"\f147"}#available-menu-items .accordion-section-title.loading .spinner,#available-menu-items-search.loading .accordion-section-title .spinner{visibility:visible;margin:0 20px}#available-menu-items-search .spinner{position:absolute;top:18px;margin:0!important;left:20px}#available-menu-items-search input{padding:6px 10px;width:100%}#available-menu-items-search .accordion-section-title{padding:12px 15px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}#available-menu-items-search .accordion-section-title:after{display:none}#available-menu-items-search .accordion-section-content:empty{min-height:0;padding:0}#available-menu-items-search.loading .accordion-section-content div{opacity:.5}#available-menu-items-search.loading.loading-more .accordion-section-content div{opacity:1}#customize-preview{-webkit-transition:all .2s;transition:all .2s}body.adding-menu-items #available-menu-items{right:0}body.adding-menu-items .wp-full-overlay-main{right:300px}body.adding-menu-items #customize-preview{opacity:.4}.menu-item-handle .spinner{display:none;float:right;margin:0 0 0 8px}.nav-menu-inserted-item-loading .spinner{display:block}.nav-menu-inserted-item-loading .menu-item-handle .item-type{padding:0 8px 0 0}.added-menu-item .menu-item-handle.loading,.nav-menu-inserted-item-loading .menu-item-handle{padding:10px 8px 10px 15px;cursor:default;opacity:.5;background:#fff;color:#727773}.added-menu-item .menu-item-handle{-webkit-transition-property:opacity,background,color;transition-property:opacity,background,color;-webkit-transition-duration:1.25s;transition-duration:1.25s;-webkit-transition-timing-function:cubic-bezier(.25,-2.5,.75,8);transition-timing-function:cubic-bezier(.25,-2.5,.75,8)}#accordion-section-add_menu{margin:15px 12px}.new-menu-section-content{display:none;padding:15px 0 0;overflow:hidden;clear:both}#accordion-section-add_menu .accordion-section-title{padding-right:45px}#accordion-section-add_menu .accordion-section-title:before{font:400 20px/1 dashicons;position:absolute;top:12px;right:14px;content:"\f132"}#create-new-menu-submit{float:left;margin:0 0 12px}.menu-delete-item{display:block;float:right;padding:1em 0;width:100%}li.assigned-to-menu-location .menu-delete-item{display:none}li.assigned-to-menu-location .add-new-menu-item{margin-bottom:1em}.menu-delete{color:#a00;cursor:pointer;text-decoration:underline}.menu-delete:focus,.menu-delete:hover{color:red;text-decoration:none}.menu-delete:focus{-webkit-box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8);box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8)}.menu-item-handle{margin-top:-1px}.ui-sortable-disabled .menu-item-handle{cursor:default}.menu-item-handle:hover{position:relative;z-index:10;color:#0073aa}#available-menu-items .menu-item-handle:hover .item-add,.menu-item-handle:hover .item-edit,.menu-item-handle:hover .item-type{color:#0073aa}.menu-item-edit-active .menu-item-handle{border-color:#999;border-bottom:none}.customize-control-nav_menu_item{margin-bottom:0}.customize-control-nav_menu{margin-top:12px}#available-menu-items .customize-section-title{display:none}@media screen and (max-width:640px){body.adding-menu-items div#available-menu-items{top:46px;right:0;z-index:10;width:100%}#available-menu-items .customize-section-title{display:block;margin:0}#available-menu-items .customize-section-back{height:69px}#available-menu-items .customize-section-title h3{font-size:20px;font-weight:200;padding:9px 14px 12px 10px;margin:0;line-height:24px;color:#555;display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}#available-menu-items .customize-section-title .customize-action{font-size:13px;display:block;font-weight:400;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}}
\ No newline at end of file
diff --git a/wp-admin/css/customize-nav-menus.css b/wp-admin/css/customize-nav-menus.css
new file mode 100644
index 0000000000..9c4fd1366e
--- /dev/null
+++ b/wp-admin/css/customize-nav-menus.css
@@ -0,0 +1,964 @@
+#accordion-section-menu_locations {
+ position: relative;
+ margin-bottom: 15px;
+}
+
+.menu-in-location,
+.menu-in-locations {
+ display: block;
+ color: #999;
+ font-weight: 600;
+ font-size: 10px;
+}
+
+#customize-controls .control-section .accordion-section-title:focus .menu-in-location,
+#customize-controls .control-section .accordion-section-title:hover .menu-in-location,
+#customize-controls .control-section .accordion-section-title:focus .menu-in-locations,
+#customize-controls .control-section .accordion-section-title:hover .menu-in-locations {
+ color: #fff;
+}
+
+.wp-customizer .menu-item-bar .menu-item-handle,
+.wp-customizer .menu-item-settings,
+.wp-customizer .menu-item-settings .description-thin {
+ -webkit-box-sizing: border-box;
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+}
+
+.wp-customizer .menu-item-bar {
+ margin: 0;
+}
+
+.wp-customizer .menu-item-bar .menu-item-handle {
+ max-width: 100%;
+ background: #fff;
+}
+
+.wp-customizer .menu-item-handle .item-title {
+ margin-right: 0;
+}
+
+.wp-customizer .menu-item-handle .item-type {
+ padding: 1px 15px 0 5px;
+ float: right;
+ text-align: right;
+}
+
+.wp-customizer .menu-item-settings {
+ max-width: 100%;
+ overflow: hidden;
+ padding: 10px;
+ background: #eee;
+ border: 1px solid #999;
+ border-top: none;
+}
+
+.wp-customizer .menu-item-settings .description-thin {
+ width: 100%;
+ height: auto;
+ margin: 0 0 8px 0;
+}
+
+.wp-customizer .menu-item-settings input[type="text"] {
+ width: 100%;
+}
+
+.wp-customizer .menu-item-settings .submitbox {
+ margin: 0;
+ padding: 0;
+}
+
+.wp-customizer .menu-item-settings .link-to-original {
+ padding: 5px 0;
+ border: none;
+ font-style: normal;
+ margin: 0;
+ width: 100%;
+}
+
+.wp-customizer .menu-item .submitbox .submitdelete {
+ display: block;
+ float: left;
+ margin: 6px 0 0;
+ padding: 0;
+ cursor: pointer;
+}
+
+.wp-customizer .menu-item .submitbox .submitdelete:focus {
+ -webkit-box-shadow: 0 0 0 1px #5b9dd9, 0 0 2px 1px rgba(30, 140, 190, .8);
+ box-shadow: 0 0 0 1px #5b9dd9, 0 0 2px 1px rgba(30, 140, 190, .8);
+}
+
+/* Menu-item reordering nav. */
+#customize-theme-controls button.reorder-toggle {
+ padding: 5px 8px;
+}
+
+.menu-item-reorder-nav {
+ display: none;
+ background-color: #fff;
+ position: absolute;
+ top: 0;
+ right: 0;
+}
+
+#customize-theme-controls .reordering .add-new-menu-item {
+ opacity: 0.2;
+ pointer-events: none;
+ cursor: not-allowed;
+}
+
+.menu-item-reorder-nav button {
+ position: relative;
+ overflow: hidden;
+ float: left;
+ display: block;
+ width: 30px;
+ height: 40px;
+ color: #82878c;
+ text-indent: -9999px;
+ cursor: pointer;
+ background: transparent;
+ border: none;
+ -webkit-box-shadow: none;
+ box-shadow: none;
+ outline: none;
+}
+
+.menu-item-reorder-nav button:before {
+ display: inline-block;
+ position: absolute;
+ top: 0;
+ right: 0;
+ width: 100%;
+ height: 100%;
+ font: normal 20px/40px dashicons;
+ text-align: center;
+ text-indent: 0;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+}
+
+.menu-item-reorder-nav button:hover,
+.menu-item-reorder-nav button:focus {
+ color: #191e23;
+ background: #eee;
+}
+
+.menus-move-down:before {
+ content: '\f347';
+}
+
+.menus-move-up:before {
+ content: '\f343';
+}
+
+.menus-move-left:before {
+ content: '\f341';
+}
+
+.menus-move-right:before {
+ content: '\f345';
+}
+
+.move-up-disabled .menus-move-up,
+.move-down-disabled .menus-move-down,
+.move-right-disabled .menus-move-right,
+.move-left-disabled .menus-move-left,
+.menu-item-depth-0 .menus-move-left,
+.menu-item-depth-10 .menus-move-right {
+ color: #d5d5d5 !important;
+ background-color: #fff !important;
+ cursor: default;
+ pointer-events: none;
+}
+
+.menu-item-reorder-nav:before {
+ content: "";
+ display: block;
+ position: absolute;
+ left: -10px;
+ width: 10px;
+ height: 40px;
+ background: -webkit-linear-gradient(left, rgba(250,250,250,0) 0%,rgba(250,250,250,1) 100%);
+ background: -webkit-gradient(linear, left top, right top, from(rgba(250,250,250,0)), to(rgba(250,250,250,1)));
+ background: -webkit-linear-gradient(left, rgba(250,250,250,0) 0%, rgba(250,250,250,1) 100%);
+ background: linear-gradient(to right, rgba(250,250,250,0) 0%,rgba(250,250,250,1) 100%);
+}
+
+.reordering .menu-item .item-controls,
+.reordering .menu-item .item-type {
+ display: none;
+}
+
+.reordering .menu-item-reorder-nav {
+ display: block;
+}
+
+.customize-control input.menu-name-field {
+ width: 100%; /* Override the 98% default for customizer inputs, to align with the size of menu items. */
+ margin: 12px 0;
+}
+
+.wp-customizer .menu-item .item-edit {
+ position: absolute;
+ right: -19px;
+ top: 2px;
+ display: block;
+ width: 30px;
+ height: 38px;
+ margin-right: 0 !important;
+ text-indent: 100%;
+ outline: none;
+ overflow: hidden;
+ white-space: nowrap;
+ cursor: pointer;
+}
+
+.customize-control-nav_menu_item .item-edit:focus {
+ color: #0073aa;
+ -webkit-box-shadow: 0 0 0 1px #5b9dd9, 0 0 2px 1px rgba(30, 140, 190, .8);
+ box-shadow: 0 0 0 1px #5b9dd9, 0 0 2px 1px rgba(30, 140, 190, .8);
+}
+
+/* Duplicates `.nav-menus-php .item-edit:before {}` in common.css:2220. */
+.wp-customizer .menu-item .item-edit:before {
+ top: -1px;
+ right: 0;
+ content: '\f140';
+ border: none;
+ background: none;
+ font: normal 20px/1 dashicons;
+ speak: none;
+ display: block;
+ padding: 0;
+ text-indent: 0;
+ text-align: center;
+ position: relative;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+ text-decoration: none !important;
+}
+
+.wp-customizer .menu-item.menu-item-edit-active .item-edit:before {
+ content: '\f142';
+}
+
+.wp-customizer .menu-item .item-edit:before {
+ line-height: 2;
+}
+
+/* Duplicates `.nav-menus-php .menu-item-edit-active .item-edit:before {}` in common.css:2271. */
+.wp-customizer .menu-item .menu-item-edit-active .item-edit:before {
+ content: '\f142';
+}
+
+.wp-customizer .menu-item-settings p.description {
+ font-style: normal;
+}
+
+.wp-customizer .menu-settings dl {
+ margin: 12px 0 0 0;
+ padding: 0;
+}
+
+.wp-customizer .menu-settings .checkbox-input {
+ margin-top: 8px;
+}
+
+.wp-customizer .menu-settings .menu-theme-locations {
+ border-top: 1px solid #ccc;
+}
+
+.wp-customizer .menu-settings {
+ margin-top: 36px;
+ border-top: none;
+}
+
+.menu-settings .customize-control-checkbox label {
+ line-height: 1;
+}
+
+/* @todo update selector or potentially remove */
+.menu-settings .customize-control.customize-control-checkbox {
+ margin-bottom: 8px; /* Override collapsing at smaller viewports. */
+}
+
+.customize-control-menu {
+ margin-top: 4px;
+}
+
+#customize-controls .customize-info.open.active-menu-screen-options .customize-help-toggle {
+ color: #555;
+}
+
+/* Screen Options */
+.customize-screen-options-toggle {
+ background: none;
+ border: none;
+ color: #555;
+ cursor: pointer;
+ padding: 20px;
+ position: absolute;
+ right: 31px;
+ top: 4px;
+}
+
+#customize-controls .customize-info .customize-help-toggle {
+ padding: 20px;
+}
+
+#customize-controls .customize-info .customize-help-toggle:before {
+ padding: 5px;
+}
+
+.customize-screen-options-toggle:hover,
+.customize-screen-options-toggle:active,
+.customize-screen-options-toggle:focus,
+.active-menu-screen-options .customize-screen-options-toggle,
+#customize-controls .customize-info.open.active-menu-screen-options .customize-help-toggle:hover,
+#customize-controls .customize-info.open.active-menu-screen-options .customize-help-toggle:active,
+#customize-controls .customize-info.open.active-menu-screen-options .customize-help-toggle:focus {
+ color: #0073aa;
+}
+
+.customize-screen-options-toggle:focus,
+#customize-controls .customize-info .customize-help-toggle:focus {
+ outline: none;
+ -webkit-box-shadow: 0 0 0 1px #5b9dd9, 0 0 2px 1px rgba(30, 140, 190, .8);
+ box-shadow: 0 0 0 1px #5b9dd9, 0 0 2px 1px rgba(30, 140, 190, .8);
+}
+
+.customize-screen-options-toggle:before {
+ -moz-osx-font-smoothing: grayscale;
+ border: none;
+ content: "\f111";
+ display: block;
+ font: 20px/1 "dashicons";
+ padding: 5px;
+ text-align: center;
+ text-decoration: none !important;
+ text-indent: 0;
+ left: 5px;
+ position: absolute;
+ top: 5px;
+}
+
+.wp-customizer #screen-options-wrap {
+ display: none;
+ background: #fff;
+ border-top: 1px solid #ddd;
+ padding: 4px 15px 0;
+}
+
+.wp-customizer .metabox-prefs label {
+ display: block;
+ padding-right: 0;
+ line-height: 30px;
+}
+
+#accordion-panel-menus .field-link-target,
+#accordion-panel-menus .field-attr-title,
+#accordion-panel-menus .field-css-classes,
+#accordion-panel-menus .field-xfn,
+#accordion-panel-menus .field-description {
+ display: none;
+}
+
+#accordion-panel-menus.field-link-target-active .field-link-target,
+#accordion-panel-menus.field-attr-title-active .field-attr-title,
+#accordion-panel-menus.field-css-classes-active .field-css-classes,
+#accordion-panel-menus.field-xfn-active .field-xfn,
+#accordion-panel-menus.field-description-active .field-description {
+ display: block;
+}
+
+
+/* Not exactly sure what broke this, or why it works without these styles in core. */
+.wp-customizer .wp-full-overlay a.collapse-sidebar {
+ position: fixed;
+ left: 0;
+}
+
+/* WARNING: The 20px factor is hard-coded in JS. */
+.menu-item-depth-0 { margin-left: 0; }
+.menu-item-depth-1 { margin-left: 20px; }
+.menu-item-depth-2 { margin-left: 40px; }
+.menu-item-depth-3 { margin-left: 60px; }
+.menu-item-depth-4 { margin-left: 80px; }
+.menu-item-depth-5 { margin-left: 100px; }
+.menu-item-depth-6 { margin-left: 120px; }
+.menu-item-depth-7 { margin-left: 140px; }
+.menu-item-depth-8 { margin-left: 160px; } /* Not likely to be used or useful beyond this depth */
+.menu-item-depth-9 { margin-left: 180px; }
+.menu-item-depth-10 { margin-left: 200px; }
+.menu-item-depth-11 { margin-left: 220px; }
+
+/* @todo handle .menu-item-settings width */
+.menu-item-depth-0 > .menu-item-bar { margin-right: 0; }
+.menu-item-depth-1 > .menu-item-bar { margin-right: 20px; }
+.menu-item-depth-2 > .menu-item-bar { margin-right: 40px; }
+.menu-item-depth-3 > .menu-item-bar { margin-right: 60px; }
+.menu-item-depth-4 > .menu-item-bar { margin-right: 80px; }
+.menu-item-depth-5 > .menu-item-bar { margin-right: 100px; }
+.menu-item-depth-6 > .menu-item-bar { margin-right: 120px; }
+.menu-item-depth-7 > .menu-item-bar { margin-right: 140px; }
+.menu-item-depth-8 > .menu-item-bar { margin-right: 160px; }
+.menu-item-depth-9 > .menu-item-bar { margin-right: 180px; }
+.menu-item-depth-10 > .menu-item-bar { margin-right: 200px; }
+.menu-item-depth-11 > .menu-item-bar { margin-right: 220px; }
+
+/* Submenu left margin. */
+/* @todo menu-item-transport seems entirely unused. */
+.menu-item-depth-0 .menu-item-transport { margin-left: 0; }
+.menu-item-depth-1 .menu-item-transport { margin-left: -20px; }
+.menu-item-depth-3 .menu-item-transport { margin-left: -60px; }
+.menu-item-depth-4 .menu-item-transport { margin-left: -80px; }
+.menu-item-depth-2 .menu-item-transport { margin-left: -40px; }
+.menu-item-depth-5 .menu-item-transport { margin-left: -100px; }
+.menu-item-depth-6 .menu-item-transport { margin-left: -120px; }
+.menu-item-depth-7 .menu-item-transport { margin-left: -140px; }
+.menu-item-depth-8 .menu-item-transport { margin-left: -160px; }
+.menu-item-depth-9 .menu-item-transport { margin-left: -180px; }
+.menu-item-depth-10 .menu-item-transport { margin-left: -200px; }
+.menu-item-depth-11 .menu-item-transport { margin-left: -220px; }
+
+/* WARNING: The 20px factor is hard-coded in JS. */
+.reordering .menu-item-depth-0 { margin-left: 0; }
+.reordering .menu-item-depth-1 { margin-left: 15px; }
+.reordering .menu-item-depth-2 { margin-left: 30px; }
+.reordering .menu-item-depth-3 { margin-left: 45px; }
+.reordering .menu-item-depth-4 { margin-left: 60px; }
+.reordering .menu-item-depth-5 { margin-left: 75px; }
+.reordering .menu-item-depth-6 { margin-left: 90px; }
+.reordering .menu-item-depth-7 { margin-left: 105px; }
+.reordering .menu-item-depth-8 { margin-left: 120px; } /* Not likely to be used or useful beyond this depth */
+.reordering .menu-item-depth-9 { margin-left: 135px; }
+.reordering .menu-item-depth-10 { margin-left: 150px; }
+.reordering .menu-item-depth-11 { margin-left: 165px; }
+
+.reordering .menu-item-depth-0 > .menu-item-bar { margin-right: 0; }
+.reordering .menu-item-depth-1 > .menu-item-bar { margin-right: 15px; }
+.reordering .menu-item-depth-2 > .menu-item-bar { margin-right: 30px; }
+.reordering .menu-item-depth-3 > .menu-item-bar { margin-right: 45px; }
+.reordering .menu-item-depth-4 > .menu-item-bar { margin-right: 60px; }
+.reordering .menu-item-depth-5 > .menu-item-bar { margin-right: 75px; }
+.reordering .menu-item-depth-6 > .menu-item-bar { margin-right: 90px; }
+.reordering .menu-item-depth-7 > .menu-item-bar { margin-right: 105px; }
+.reordering .menu-item-depth-8 > .menu-item-bar { margin-right: 120px; }
+.reordering .menu-item-depth-9 > .menu-item-bar { margin-right: 135px; }
+.reordering .menu-item-depth-10 > .menu-item-bar { margin-right: 150px; }
+.reordering .menu-item-depth-11 > .menu-item-bar { margin-right: 165px; }
+
+.control-section-nav_menu .menu .menu-item-edit-active {
+ margin-left: 0;
+}
+
+.control-section-nav_menu .menu .menu-item-edit-active .menu-item-bar {
+ margin-right: 0;
+}
+
+.control-section-nav_menu .menu .sortable-placeholder {
+ margin-top: 0;
+ margin-bottom: 1px;
+ max-width: -webkit-calc(100% - 2px);
+ max-width: calc(100% - 2px);
+ float: left;
+ display: list-item;
+ border-color: #a0a5aa;
+}
+
+.control-section-nav_menu .menu ul.menu-item-transport dl {
+ margin-top: 0;
+}
+
+/*
+ * Add-menu-items mode.
+ */
+.wp-full-overlay-main {
+ right: auto; /* This overrides a right: 0; which causes the preview to resize rather than slide off screen at the normal size. */
+ width: 100%;
+}
+
+.adding-menu-items .control-section {
+ opacity: .4;
+}
+
+.adding-menu-items .control-panel.control-section,
+.adding-menu-items .control-section.open {
+ opacity: 1;
+}
+
+/* Add-new button. */
+#customize-theme-controls .add-new-menu-item {
+ cursor: pointer;
+ float: right;
+ margin-left: 10px;
+ -webkit-transition: all 0.2s;
+ transition: all 0.2s;
+ -webkit-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
+ outline: none;
+}
+
+.add-new-menu-item:before {
+ content: "\f132";
+ display: inline-block;
+ position: relative;
+ left: -2px;
+ top: -1px;
+ font: normal 20px/1 'dashicons';
+ vertical-align: middle;
+ -webkit-transition: all 0.2s;
+ transition: all 0.2s;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+}
+
+.adding-menu-items .add-new-menu-item,
+.adding-menu-items .add-new-menu-item:hover,
+.add-menu-toggle.open,
+.add-menu-toggle.open:hover {
+ background: #eee;
+ border-color: #929793;
+ color: #32373c;
+ -webkit-box-shadow: inset 0 2px 5px -3px rgba(0, 0, 0, 0.5);
+ box-shadow: inset 0 2px 5px -3px rgba(0, 0, 0, 0.5);
+}
+
+.adding-menu-items .add-new-menu-item:before,
+#accordion-section-add_menu .add-new-menu-item.open:before {
+ -webkit-transform: rotate(45deg);
+ -ms-transform: rotate(45deg);
+ transform: rotate(45deg);
+}
+
+.menu-item-bar .item-delete {
+ color: #a00;
+ position: absolute;
+ top: 2px;
+ right: -19px;
+ width: 30px;
+ height: 38px;
+ cursor: pointer;
+ display: none;
+}
+
+.menu-item-bar .item-delete:before {
+ content: "\f335";
+ font: normal 20px/1 dashicons;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+ position: absolute;
+ top: 9px;
+ left: 5px;
+}
+
+.menu-item-bar .item-delete:hover,
+.menu-item-bar .item-delete:focus {
+ color: #f00;
+}
+
+.adding-menu-items .menu-item-bar .item-edit {
+ display: none;
+}
+
+.adding-menu-items .menu-item-bar .item-delete {
+ display: block;
+}
+
+#available-menu-items .item {
+ position: static;
+}
+
+#available-menu-items {
+ position: absolute;
+ overflow: hidden;
+ top: 0;
+ bottom: 0;
+ left: -301px;
+ width: 300px;
+ margin: 0;
+ z-index: 4;
+ background: #eee;
+ -webkit-transition: all 0.2s;
+ transition: all 0.2s;
+ border-right: 1px solid #ddd;
+}
+
+#available-menu-items.allow-scroll {
+ overflow-y: auto;
+}
+
+#available-menu-items .accordion-section-title {
+ border-left: none;
+ border-right: none;
+ background: #fff;
+}
+
+#available-menu-items .open .accordion-section-title {
+ background: #eee;
+}
+
+#available-menu-items .open .accordion-section-title:after {
+ content: '\f142';
+}
+
+#available-menu-items .accordion-section-content {
+ overflow-y: auto;
+ max-height: 200px; /* This gets set in JS to fit the screen size, and based on # of sections. */
+ background: transparent;
+}
+
+button.not-a-button {
+ background: transparent;
+ border: none;
+ -webkit-box-shadow: none;
+ box-shadow: none;
+ -webkit-border-radius: 0;
+ border-radius: 0;
+ outline: 0;
+ padding: 0;
+ margin: 0;
+}
+
+#available-menu-items .accordion-section-title button:focus:before {
+ display: block;
+ content: "";
+ width: 28px;
+ height: 32px;
+ position: absolute;
+ right: 5px;
+ top: 5px;
+ -webkit-box-shadow: 0 0 0 1px #5b9dd9, 0 0 2px 1px rgba(30, 140, 190, .8);
+ box-shadow: 0 0 0 1px #5b9dd9, 0 0 2px 1px rgba(30, 140, 190, .8);
+}
+
+#available-menu-items .accordion-section-content {
+ padding: 1px 15px 15px 15px;
+ min-height: 120px;
+ max-height: 290px;
+}
+
+#custom-menu-item-name.invalid,
+#custom-menu-item-url.invalid {
+ border: 1px solid #f00;
+}
+
+#available-menu-items .item-tpl {
+ position: relative;
+ padding: 20px 15px 20px 60px;
+ border-bottom: 1px solid #e4e4e4;
+ cursor: pointer;
+ display: none;
+}
+
+#available-menu-items .item-tpl:hover,
+#available-menu-items .item-tpl.selected {
+ background: #eee;
+}
+
+#available-menu-items .menu-item-handle .item-type {
+ padding-right: 0;
+}
+
+#available-menu-items .menu-item-handle .item-title {
+ padding-left: 20px;
+}
+
+#available-menu-items .menu-item-handle {
+ cursor: pointer;
+}
+
+#available-menu-items .item-top,
+#available-menu-items .item-top:hover {
+ border: none;
+ background: transparent;
+ -webkit-box-shadow: none;
+ box-shadow: none;
+}
+
+#available-menu-items .menu-item-handle {
+ -webkit-box-shadow: none;
+ box-shadow: none;
+ margin-top: -1px;
+}
+
+#available-menu-items .menu-item-handle:hover {
+ z-index: 1;
+}
+
+#available-menu-items .item-title h4 {
+ padding: 0 0 5px;
+ font-size: 14px;
+}
+
+#available-menu-items .item-add {
+ position: absolute;
+ top: 1px;
+ left: 1px;
+ color: #82878c;
+ width: 30px;
+ height: 38px;
+ cursor: pointer;
+}
+
+#available-menu-items .menu-item-handle .item-add:focus {
+ color: #23282d;
+ -webkit-box-shadow: 0 0 0 1px #5b9dd9, 0 0 2px 1px rgba(30, 140, 190, .8);
+ box-shadow: 0 0 0 1px #5b9dd9, 0 0 2px 1px rgba(30, 140, 190, .8);
+}
+
+#available-menu-items .item-add:before {
+ content: "\f132";
+ font: normal 20px/1 dashicons;
+ position: relative;
+ left: 2px;
+ top: 4px;
+}
+
+#available-menu-items .menu-item-handle.item-added .item-type,
+#available-menu-items .menu-item-handle.item-added .item-title,
+#available-menu-items .menu-item-handle.item-added:hover .item-add,
+#available-menu-items .menu-item-handle.item-added .item-add:focus {
+ color: #82878c;
+}
+
+#available-menu-items .menu-item-handle.item-added .item-add:before {
+ content: "\f147";
+}
+
+#available-menu-items .accordion-section-title.loading .spinner,
+#available-menu-items-search.loading .accordion-section-title .spinner {
+ visibility: visible;
+ margin: 0 20px;
+}
+
+#available-menu-items-search .spinner {
+ position: absolute;
+ top: 18px;
+ margin: 0 !important;
+ right: 20px;
+}
+
+#available-menu-items-search input {
+ padding: 6px 10px;
+ width: 100%;
+}
+
+#available-menu-items-search .accordion-section-title {
+ padding: 12px 15px;
+ -webkit-box-sizing: border-box;
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+}
+
+#available-menu-items-search .accordion-section-title:after {
+ display: none;
+}
+
+#available-menu-items-search .accordion-section-content:empty {
+ min-height: 0;
+ padding: 0;
+}
+
+#available-menu-items-search.loading .accordion-section-content div {
+ opacity: .5;
+}
+
+#available-menu-items-search.loading.loading-more .accordion-section-content div {
+ opacity: 1;
+}
+
+#customize-preview {
+ -webkit-transition: all 0.2s;
+ transition: all 0.2s;
+}
+
+body.adding-menu-items #available-menu-items {
+ left: 0;
+}
+
+body.adding-menu-items .wp-full-overlay-main {
+ left: 300px;
+}
+
+body.adding-menu-items #customize-preview {
+ opacity: 0.4;
+}
+
+.menu-item-handle .spinner {
+ display: none;
+ float: left;
+ margin: 0 8px 0 0;
+}
+
+.nav-menu-inserted-item-loading .spinner {
+ display: block;
+}
+
+.nav-menu-inserted-item-loading .menu-item-handle .item-type {
+ padding: 0 0 0 8px;
+}
+
+.nav-menu-inserted-item-loading .menu-item-handle,
+.added-menu-item .menu-item-handle.loading {
+ padding: 10px 15px 10px 8px;
+ cursor: default;
+ opacity: .5;
+ background: #fff;
+ color: #727773;
+}
+
+.added-menu-item .menu-item-handle {
+ -webkit-transition-property: opacity, background, color;
+ transition-property: opacity, background, color;
+ -webkit-transition-duration: 1.25s;
+ transition-duration: 1.25s;
+ -webkit-transition-timing-function: cubic-bezier( .25, -2.5, .75, 8 );
+ transition-timing-function: cubic-bezier( .25, -2.5, .75, 8 ); /* Replacement for .hide().fadeIn('slow') in JS to add emphasis when it's loaded. */
+}
+
+/* Add/delete Menus */
+
+/* @todo update selector */
+#accordion-section-add_menu {
+ margin: 15px 12px;
+}
+
+.new-menu-section-content {
+ display: none;
+ padding: 15px 0 0 0;
+ overflow: hidden;
+ clear: both;
+}
+
+/* @todo update selector */
+#accordion-section-add_menu .accordion-section-title {
+ padding-left: 45px;
+}
+
+/* @todo update selector */
+#accordion-section-add_menu .accordion-section-title:before {
+ font: normal 20px/1 dashicons;
+ position: absolute;
+ top: 12px;
+ left: 14px;
+ content: "\f132";
+}
+
+#create-new-menu-submit {
+ float: right;
+ margin: 0 0 12px 0;
+}
+
+.menu-delete-item {
+ display: block;
+ float: left;
+ padding: 1em 0;
+ width: 100%;
+}
+
+li.assigned-to-menu-location .menu-delete-item {
+ display: none;
+}
+
+li.assigned-to-menu-location .add-new-menu-item {
+ margin-bottom: 1em;
+}
+
+.menu-delete {
+ color: #a00;
+ cursor: pointer;
+ text-decoration: underline;
+}
+
+.menu-delete:hover,
+.menu-delete:focus {
+ color: #f00;
+ text-decoration: none;
+}
+
+.menu-delete:focus {
+ -webkit-box-shadow: 0 0 0 1px #5b9dd9, 0 0 2px 1px rgba(30, 140, 190, .8);
+ box-shadow: 0 0 0 1px #5b9dd9, 0 0 2px 1px rgba(30, 140, 190, .8);
+}
+
+.menu-item-handle {
+ margin-top: -1px;
+}
+.ui-sortable-disabled .menu-item-handle {
+ cursor: default;
+}
+
+.menu-item-handle:hover {
+ position: relative;
+ z-index: 10;
+ color: #0073aa;
+}
+
+.menu-item-handle:hover .item-type,
+.menu-item-handle:hover .item-edit,
+#available-menu-items .menu-item-handle:hover .item-add {
+ color: #0073aa;
+}
+
+.menu-item-edit-active .menu-item-handle {
+ border-color: #999;
+ border-bottom: none;
+}
+
+.customize-control-nav_menu_item {
+ margin-bottom: 0;
+}
+
+.customize-control-nav_menu {
+ margin-top: 12px;
+}
+
+#available-menu-items .customize-section-title {
+ display: none;
+}
+
+@media screen and ( max-width: 640px ) {
+ body.adding-menu-items div#available-menu-items {
+ top: 46px;
+ left: 0;
+ z-index: 10;
+ width: 100%;
+ }
+
+ #available-menu-items .customize-section-title {
+ display: block;
+ margin: 0;
+ }
+
+ #available-menu-items .customize-section-back {
+ height: 69px;
+ }
+
+ #available-menu-items .customize-section-title h3 {
+ font-size: 20px;
+ font-weight: 200;
+ padding: 9px 10px 12px 14px;
+ margin: 0;
+ line-height: 24px;
+ color: #555;
+ display: block;
+ overflow: hidden;
+ white-space: nowrap;
+ text-overflow: ellipsis;
+ }
+
+ #available-menu-items .customize-section-title .customize-action {
+ font-size: 13px;
+ display: block;
+ font-weight: 400;
+ overflow: hidden;
+ white-space: nowrap;
+ text-overflow: ellipsis;
+ }
+}
diff --git a/wp-admin/css/customize-nav-menus.min.css b/wp-admin/css/customize-nav-menus.min.css
new file mode 100644
index 0000000000..70fc05884a
--- /dev/null
+++ b/wp-admin/css/customize-nav-menus.min.css
@@ -0,0 +1 @@
+#accordion-section-menu_locations{position:relative;margin-bottom:15px}.menu-in-location,.menu-in-locations{display:block;color:#999;font-weight:600;font-size:10px}#customize-controls .control-section .accordion-section-title:focus .menu-in-location,#customize-controls .control-section .accordion-section-title:focus .menu-in-locations,#customize-controls .control-section .accordion-section-title:hover .menu-in-location,#customize-controls .control-section .accordion-section-title:hover .menu-in-locations{color:#fff}.wp-customizer .menu-item-bar .menu-item-handle,.wp-customizer .menu-item-settings,.wp-customizer .menu-item-settings .description-thin{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.wp-customizer .menu-item-bar{margin:0}.wp-customizer .menu-item-bar .menu-item-handle{max-width:100%;background:#fff}.wp-customizer .menu-item-handle .item-title{margin-right:0}.wp-customizer .menu-item-handle .item-type{padding:1px 15px 0 5px;float:right;text-align:right}.wp-customizer .menu-item-settings{max-width:100%;overflow:hidden;padding:10px;background:#eee;border:1px solid #999;border-top:none}.wp-customizer .menu-item-settings .description-thin{width:100%;height:auto;margin:0 0 8px}.wp-customizer .menu-item-settings input[type=text]{width:100%}.wp-customizer .menu-item-settings .submitbox{margin:0;padding:0}.wp-customizer .menu-item-settings .link-to-original{padding:5px 0;border:none;font-style:normal;margin:0;width:100%}.wp-customizer .menu-item .submitbox .submitdelete{display:block;float:left;margin:6px 0 0;padding:0;cursor:pointer}.wp-customizer .menu-item .submitbox .submitdelete:focus{-webkit-box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8);box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8)}#customize-theme-controls button.reorder-toggle{padding:5px 8px}.menu-item-reorder-nav{display:none;background-color:#fff;position:absolute;top:0;right:0}#customize-theme-controls .reordering .add-new-menu-item{opacity:.2;pointer-events:none;cursor:not-allowed}.menu-item-reorder-nav button{position:relative;overflow:hidden;float:left;display:block;width:30px;height:40px;color:#82878c;text-indent:-9999px;cursor:pointer;background:0 0;border:none;-webkit-box-shadow:none;box-shadow:none;outline:0}.menu-item-reorder-nav button:before{display:inline-block;position:absolute;top:0;right:0;width:100%;height:100%;font:400 20px/40px dashicons;text-align:center;text-indent:0;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.menu-item-reorder-nav button:focus,.menu-item-reorder-nav button:hover{color:#191e23;background:#eee}.menus-move-down:before{content:'\f347'}.menus-move-up:before{content:'\f343'}.menus-move-left:before{content:'\f341'}.menus-move-right:before{content:'\f345'}.menu-item-depth-0 .menus-move-left,.menu-item-depth-10 .menus-move-right,.move-down-disabled .menus-move-down,.move-left-disabled .menus-move-left,.move-right-disabled .menus-move-right,.move-up-disabled .menus-move-up{color:#d5d5d5!important;background-color:#fff!important;cursor:default;pointer-events:none}.menu-item-reorder-nav:before{content:"";display:block;position:absolute;left:-10px;width:10px;height:40px;background:-webkit-gradient(linear,left top,right top,from(rgba(250,250,250,0)),to(rgba(250,250,250,1)));background:-webkit-linear-gradient(left,rgba(250,250,250,0) 0,rgba(250,250,250,1) 100%);background:linear-gradient(to right,rgba(250,250,250,0) 0,rgba(250,250,250,1) 100%)}.reordering .menu-item .item-controls,.reordering .menu-item .item-type{display:none}.reordering .menu-item-reorder-nav{display:block}.customize-control input.menu-name-field{width:100%;margin:12px 0}.wp-customizer .menu-item .item-edit{position:absolute;right:-19px;top:2px;display:block;width:30px;height:38px;margin-right:0!important;text-indent:100%;outline:0;overflow:hidden;white-space:nowrap;cursor:pointer}.customize-control-nav_menu_item .item-edit:focus{color:#0073aa;-webkit-box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8);box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8)}.wp-customizer .menu-item .item-edit:before{top:-1px;right:0;content:'\f140';border:none;background:0 0;font:400 20px/1 dashicons;speak:none;display:block;padding:0;text-indent:0;text-align:center;position:relative;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-decoration:none!important}.wp-customizer .menu-item.menu-item-edit-active .item-edit:before{content:'\f142'}.wp-customizer .menu-item .item-edit:before{line-height:2}.wp-customizer .menu-item .menu-item-edit-active .item-edit:before{content:'\f142'}.wp-customizer .menu-item-settings p.description{font-style:normal}.wp-customizer .menu-settings dl{margin:12px 0 0;padding:0}.wp-customizer .menu-settings .checkbox-input{margin-top:8px}.wp-customizer .menu-settings .menu-theme-locations{border-top:1px solid #ccc}.wp-customizer .menu-settings{margin-top:36px;border-top:none}.menu-settings .customize-control-checkbox label{line-height:1}.menu-settings .customize-control.customize-control-checkbox{margin-bottom:8px}.customize-control-menu{margin-top:4px}#customize-controls .customize-info.open.active-menu-screen-options .customize-help-toggle{color:#555}.customize-screen-options-toggle{background:0 0;border:none;color:#555;cursor:pointer;padding:20px;position:absolute;right:31px;top:4px}#customize-controls .customize-info .customize-help-toggle{padding:20px}#customize-controls .customize-info .customize-help-toggle:before{padding:5px}#customize-controls .customize-info.open.active-menu-screen-options .customize-help-toggle:active,#customize-controls .customize-info.open.active-menu-screen-options .customize-help-toggle:focus,#customize-controls .customize-info.open.active-menu-screen-options .customize-help-toggle:hover,.active-menu-screen-options .customize-screen-options-toggle,.customize-screen-options-toggle:active,.customize-screen-options-toggle:focus,.customize-screen-options-toggle:hover{color:#0073aa}#customize-controls .customize-info .customize-help-toggle:focus,.customize-screen-options-toggle:focus{outline:0;-webkit-box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8);box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8)}.customize-screen-options-toggle:before{-moz-osx-font-smoothing:grayscale;border:none;content:"\f111";display:block;font:20px/1 dashicons;padding:5px;text-align:center;text-decoration:none!important;text-indent:0;left:5px;position:absolute;top:5px}.wp-customizer #screen-options-wrap{display:none;background:#fff;border-top:1px solid #ddd;padding:4px 15px 0}.wp-customizer .metabox-prefs label{display:block;padding-right:0;line-height:30px}#accordion-panel-menus .field-attr-title,#accordion-panel-menus .field-css-classes,#accordion-panel-menus .field-description,#accordion-panel-menus .field-link-target,#accordion-panel-menus .field-xfn{display:none}#accordion-panel-menus.field-attr-title-active .field-attr-title,#accordion-panel-menus.field-css-classes-active .field-css-classes,#accordion-panel-menus.field-description-active .field-description,#accordion-panel-menus.field-link-target-active .field-link-target,#accordion-panel-menus.field-xfn-active .field-xfn{display:block}.wp-customizer .wp-full-overlay a.collapse-sidebar{position:fixed;left:0}.menu-item-depth-0{margin-left:0}.menu-item-depth-1{margin-left:20px}.menu-item-depth-2{margin-left:40px}.menu-item-depth-3{margin-left:60px}.menu-item-depth-4{margin-left:80px}.menu-item-depth-5{margin-left:100px}.menu-item-depth-6{margin-left:120px}.menu-item-depth-7{margin-left:140px}.menu-item-depth-8{margin-left:160px}.menu-item-depth-9{margin-left:180px}.menu-item-depth-10{margin-left:200px}.menu-item-depth-11{margin-left:220px}.menu-item-depth-0>.menu-item-bar{margin-right:0}.menu-item-depth-1>.menu-item-bar{margin-right:20px}.menu-item-depth-2>.menu-item-bar{margin-right:40px}.menu-item-depth-3>.menu-item-bar{margin-right:60px}.menu-item-depth-4>.menu-item-bar{margin-right:80px}.menu-item-depth-5>.menu-item-bar{margin-right:100px}.menu-item-depth-6>.menu-item-bar{margin-right:120px}.menu-item-depth-7>.menu-item-bar{margin-right:140px}.menu-item-depth-8>.menu-item-bar{margin-right:160px}.menu-item-depth-9>.menu-item-bar{margin-right:180px}.menu-item-depth-10>.menu-item-bar{margin-right:200px}.menu-item-depth-11>.menu-item-bar{margin-right:220px}.menu-item-depth-0 .menu-item-transport{margin-left:0}.menu-item-depth-1 .menu-item-transport{margin-left:-20px}.menu-item-depth-3 .menu-item-transport{margin-left:-60px}.menu-item-depth-4 .menu-item-transport{margin-left:-80px}.menu-item-depth-2 .menu-item-transport{margin-left:-40px}.menu-item-depth-5 .menu-item-transport{margin-left:-100px}.menu-item-depth-6 .menu-item-transport{margin-left:-120px}.menu-item-depth-7 .menu-item-transport{margin-left:-140px}.menu-item-depth-8 .menu-item-transport{margin-left:-160px}.menu-item-depth-9 .menu-item-transport{margin-left:-180px}.menu-item-depth-10 .menu-item-transport{margin-left:-200px}.menu-item-depth-11 .menu-item-transport{margin-left:-220px}.reordering .menu-item-depth-0{margin-left:0}.reordering .menu-item-depth-1{margin-left:15px}.reordering .menu-item-depth-2{margin-left:30px}.reordering .menu-item-depth-3{margin-left:45px}.reordering .menu-item-depth-4{margin-left:60px}.reordering .menu-item-depth-5{margin-left:75px}.reordering .menu-item-depth-6{margin-left:90px}.reordering .menu-item-depth-7{margin-left:105px}.reordering .menu-item-depth-8{margin-left:120px}.reordering .menu-item-depth-9{margin-left:135px}.reordering .menu-item-depth-10{margin-left:150px}.reordering .menu-item-depth-11{margin-left:165px}.reordering .menu-item-depth-0>.menu-item-bar{margin-right:0}.reordering .menu-item-depth-1>.menu-item-bar{margin-right:15px}.reordering .menu-item-depth-2>.menu-item-bar{margin-right:30px}.reordering .menu-item-depth-3>.menu-item-bar{margin-right:45px}.reordering .menu-item-depth-4>.menu-item-bar{margin-right:60px}.reordering .menu-item-depth-5>.menu-item-bar{margin-right:75px}.reordering .menu-item-depth-6>.menu-item-bar{margin-right:90px}.reordering .menu-item-depth-7>.menu-item-bar{margin-right:105px}.reordering .menu-item-depth-8>.menu-item-bar{margin-right:120px}.reordering .menu-item-depth-9>.menu-item-bar{margin-right:135px}.reordering .menu-item-depth-10>.menu-item-bar{margin-right:150px}.reordering .menu-item-depth-11>.menu-item-bar{margin-right:165px}.control-section-nav_menu .menu .menu-item-edit-active{margin-left:0}.control-section-nav_menu .menu .menu-item-edit-active .menu-item-bar{margin-right:0}.control-section-nav_menu .menu .sortable-placeholder{margin-top:0;margin-bottom:1px;max-width:-webkit-calc(100% - 2px);max-width:calc(100% - 2px);float:left;display:list-item;border-color:#a0a5aa}.control-section-nav_menu .menu ul.menu-item-transport dl{margin-top:0}.wp-full-overlay-main{right:auto;width:100%}.adding-menu-items .control-section{opacity:.4}.adding-menu-items .control-panel.control-section,.adding-menu-items .control-section.open{opacity:1}#customize-theme-controls .add-new-menu-item{cursor:pointer;float:right;margin-left:10px;-webkit-transition:all .2s;transition:all .2s;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;outline:0}.add-new-menu-item:before{content:"\f132";display:inline-block;position:relative;left:-2px;top:-1px;font:400 20px/1 dashicons;vertical-align:middle;-webkit-transition:all .2s;transition:all .2s;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.add-menu-toggle.open,.add-menu-toggle.open:hover,.adding-menu-items .add-new-menu-item,.adding-menu-items .add-new-menu-item:hover{background:#eee;border-color:#929793;color:#32373c;-webkit-box-shadow:inset 0 2px 5px -3px rgba(0,0,0,.5);box-shadow:inset 0 2px 5px -3px rgba(0,0,0,.5)}#accordion-section-add_menu .add-new-menu-item.open:before,.adding-menu-items .add-new-menu-item:before{-webkit-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg)}.menu-item-bar .item-delete{color:#a00;position:absolute;top:2px;right:-19px;width:30px;height:38px;cursor:pointer;display:none}.menu-item-bar .item-delete:before{content:"\f335";font:400 20px/1 dashicons;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;position:absolute;top:9px;left:5px}.menu-item-bar .item-delete:focus,.menu-item-bar .item-delete:hover{color:red}.adding-menu-items .menu-item-bar .item-edit{display:none}.adding-menu-items .menu-item-bar .item-delete{display:block}#available-menu-items .item{position:static}#available-menu-items{position:absolute;overflow:hidden;top:0;bottom:0;left:-301px;width:300px;margin:0;z-index:4;background:#eee;-webkit-transition:all .2s;transition:all .2s;border-right:1px solid #ddd}#available-menu-items.allow-scroll{overflow-y:auto}#available-menu-items .accordion-section-title{border-left:none;border-right:none;background:#fff}#available-menu-items .open .accordion-section-title{background:#eee}#available-menu-items .open .accordion-section-title:after{content:'\f142'}#available-menu-items .accordion-section-content{overflow-y:auto;background:0 0}button.not-a-button{background:0 0;border:none;-webkit-box-shadow:none;box-shadow:none;-webkit-border-radius:0;border-radius:0;outline:0;padding:0;margin:0}#available-menu-items .accordion-section-title button:focus:before{display:block;content:"";width:28px;height:32px;position:absolute;right:5px;top:5px;-webkit-box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8);box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8)}#available-menu-items .accordion-section-content{padding:1px 15px 15px;min-height:120px;max-height:290px}#custom-menu-item-name.invalid,#custom-menu-item-url.invalid{border:1px solid red}#available-menu-items .item-tpl{position:relative;padding:20px 15px 20px 60px;border-bottom:1px solid #e4e4e4;cursor:pointer;display:none}#available-menu-items .item-tpl.selected,#available-menu-items .item-tpl:hover{background:#eee}#available-menu-items .menu-item-handle .item-type{padding-right:0}#available-menu-items .menu-item-handle .item-title{padding-left:20px}#available-menu-items .menu-item-handle{cursor:pointer}#available-menu-items .item-top,#available-menu-items .item-top:hover{border:none;background:0 0;-webkit-box-shadow:none;box-shadow:none}#available-menu-items .menu-item-handle{-webkit-box-shadow:none;box-shadow:none;margin-top:-1px}#available-menu-items .menu-item-handle:hover{z-index:1}#available-menu-items .item-title h4{padding:0 0 5px;font-size:14px}#available-menu-items .item-add{position:absolute;top:1px;left:1px;color:#82878c;width:30px;height:38px;cursor:pointer}#available-menu-items .menu-item-handle .item-add:focus{color:#23282d;-webkit-box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8);box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8)}#available-menu-items .item-add:before{content:"\f132";font:400 20px/1 dashicons;position:relative;left:2px;top:4px}#available-menu-items .menu-item-handle.item-added .item-add:focus,#available-menu-items .menu-item-handle.item-added .item-title,#available-menu-items .menu-item-handle.item-added .item-type,#available-menu-items .menu-item-handle.item-added:hover .item-add{color:#82878c}#available-menu-items .menu-item-handle.item-added .item-add:before{content:"\f147"}#available-menu-items .accordion-section-title.loading .spinner,#available-menu-items-search.loading .accordion-section-title .spinner{visibility:visible;margin:0 20px}#available-menu-items-search .spinner{position:absolute;top:18px;margin:0!important;right:20px}#available-menu-items-search input{padding:6px 10px;width:100%}#available-menu-items-search .accordion-section-title{padding:12px 15px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}#available-menu-items-search .accordion-section-title:after{display:none}#available-menu-items-search .accordion-section-content:empty{min-height:0;padding:0}#available-menu-items-search.loading .accordion-section-content div{opacity:.5}#available-menu-items-search.loading.loading-more .accordion-section-content div{opacity:1}#customize-preview{-webkit-transition:all .2s;transition:all .2s}body.adding-menu-items #available-menu-items{left:0}body.adding-menu-items .wp-full-overlay-main{left:300px}body.adding-menu-items #customize-preview{opacity:.4}.menu-item-handle .spinner{display:none;float:left;margin:0 8px 0 0}.nav-menu-inserted-item-loading .spinner{display:block}.nav-menu-inserted-item-loading .menu-item-handle .item-type{padding:0 0 0 8px}.added-menu-item .menu-item-handle.loading,.nav-menu-inserted-item-loading .menu-item-handle{padding:10px 15px 10px 8px;cursor:default;opacity:.5;background:#fff;color:#727773}.added-menu-item .menu-item-handle{-webkit-transition-property:opacity,background,color;transition-property:opacity,background,color;-webkit-transition-duration:1.25s;transition-duration:1.25s;-webkit-transition-timing-function:cubic-bezier(.25,-2.5,.75,8);transition-timing-function:cubic-bezier(.25,-2.5,.75,8)}#accordion-section-add_menu{margin:15px 12px}.new-menu-section-content{display:none;padding:15px 0 0;overflow:hidden;clear:both}#accordion-section-add_menu .accordion-section-title{padding-left:45px}#accordion-section-add_menu .accordion-section-title:before{font:400 20px/1 dashicons;position:absolute;top:12px;left:14px;content:"\f132"}#create-new-menu-submit{float:right;margin:0 0 12px}.menu-delete-item{display:block;float:left;padding:1em 0;width:100%}li.assigned-to-menu-location .menu-delete-item{display:none}li.assigned-to-menu-location .add-new-menu-item{margin-bottom:1em}.menu-delete{color:#a00;cursor:pointer;text-decoration:underline}.menu-delete:focus,.menu-delete:hover{color:red;text-decoration:none}.menu-delete:focus{-webkit-box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8);box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8)}.menu-item-handle{margin-top:-1px}.ui-sortable-disabled .menu-item-handle{cursor:default}.menu-item-handle:hover{position:relative;z-index:10;color:#0073aa}#available-menu-items .menu-item-handle:hover .item-add,.menu-item-handle:hover .item-edit,.menu-item-handle:hover .item-type{color:#0073aa}.menu-item-edit-active .menu-item-handle{border-color:#999;border-bottom:none}.customize-control-nav_menu_item{margin-bottom:0}.customize-control-nav_menu{margin-top:12px}#available-menu-items .customize-section-title{display:none}@media screen and (max-width:640px){body.adding-menu-items div#available-menu-items{top:46px;left:0;z-index:10;width:100%}#available-menu-items .customize-section-title{display:block;margin:0}#available-menu-items .customize-section-back{height:69px}#available-menu-items .customize-section-title h3{font-size:20px;font-weight:200;padding:9px 10px 12px 14px;margin:0;line-height:24px;color:#555;display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}#available-menu-items .customize-section-title .customize-action{font-size:13px;display:block;font-weight:400;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}}
\ No newline at end of file
diff --git a/wp-admin/js/customize-nav-menus.js b/wp-admin/js/customize-nav-menus.js
new file mode 100644
index 0000000000..21f8fcd6b0
--- /dev/null
+++ b/wp-admin/js/customize-nav-menus.js
@@ -0,0 +1,2513 @@
+/* global _wpCustomizeNavMenusSettings, wpNavMenu, console */
+( function( api, wp, $ ) {
+ 'use strict';
+
+ /**
+ * Set up wpNavMenu for drag and drop.
+ */
+ wpNavMenu.originalInit = wpNavMenu.init;
+ wpNavMenu.options.menuItemDepthPerLevel = 20;
+ wpNavMenu.options.sortableItems = '.customize-control-nav_menu_item';
+ wpNavMenu.init = function() {
+ this.jQueryExtensions();
+ };
+
+ api.Menus = api.Menus || {};
+
+ // Link settings.
+ api.Menus.data = {
+ nonce: '',
+ itemTypes: {
+ taxonomies: {},
+ postTypes: {}
+ },
+ l10n: {},
+ menuItemTransport: 'postMessage',
+ phpIntMax: 0,
+ defaultSettingValues: {
+ nav_menu: {},
+ nav_menu_item: {}
+ }
+ };
+ if ( 'undefined' !== typeof _wpCustomizeNavMenusSettings ) {
+ $.extend( api.Menus.data, _wpCustomizeNavMenusSettings );
+ }
+
+ /**
+ * Newly-created Nav Menus and Nav Menu Items have negative integer IDs which
+ * serve as placeholders until Save & Publish happens.
+ *
+ * @return {number}
+ */
+ api.Menus.generatePlaceholderAutoIncrementId = function() {
+ return -Math.ceil( api.Menus.data.phpIntMax * Math.random() );
+ };
+
+ /**
+ * wp.customize.Menus.AvailableItemModel
+ *
+ * A single available menu item model. See PHP's WP_Customize_Nav_Menu_Item_Setting class.
+ *
+ * @constructor
+ * @augments Backbone.Model
+ */
+ api.Menus.AvailableItemModel = Backbone.Model.extend( $.extend(
+ {
+ id: null // This is only used by Backbone.
+ },
+ api.Menus.data.defaultSettingValues.nav_menu_item
+ ) );
+
+ /**
+ * wp.customize.Menus.AvailableItemCollection
+ *
+ * Collection for available menu item models.
+ *
+ * @constructor
+ * @augments Backbone.Model
+ */
+ api.Menus.AvailableItemCollection = Backbone.Collection.extend({
+ model: api.Menus.AvailableItemModel,
+
+ sort_key: 'order',
+
+ comparator: function( item ) {
+ return -item.get( this.sort_key );
+ },
+
+ sortByField: function( fieldName ) {
+ this.sort_key = fieldName;
+ this.sort();
+ }
+ });
+ api.Menus.availableMenuItems = new api.Menus.AvailableItemCollection( api.Menus.data.availableMenuItems );
+
+ /**
+ * wp.customize.Menus.AvailableMenuItemsPanelView
+ *
+ * View class for the available menu items panel.
+ *
+ * @constructor
+ * @augments wp.Backbone.View
+ * @augments Backbone.View
+ */
+ api.Menus.AvailableMenuItemsPanelView = wp.Backbone.View.extend({
+
+ el: '#available-menu-items',
+
+ events: {
+ 'input #menu-items-search': 'debounceSearch',
+ 'change #menu-items-search': 'debounceSearch',
+ 'click #menu-items-search': 'debounceSearch',
+ 'focus .menu-item-tpl': 'focus',
+ 'click .menu-item-tpl': '_submit',
+ 'keypress .menu-item-tpl': '_submit',
+ 'click #custom-menu-item-submit': '_submitLink',
+ 'keypress #custom-menu-item-name': '_submitLink',
+ 'keydown': 'keyboardAccessible'
+ },
+
+ // Cache current selected menu item.
+ selected: null,
+
+ // Cache menu control that opened the panel.
+ currentMenuControl: null,
+ debounceSearch: null,
+ $search: null,
+ searchTerm: '',
+ rendered: false,
+ pages: {},
+ sectionContent: '',
+ loading: false,
+
+ initialize: function() {
+ var self = this;
+
+ this.$search = $( '#menu-items-search' );
+ this.sectionContent = this.$el.find( '.accordion-section-content' );
+
+ this.debounceSearch = _.debounce( self.search, 250 );
+
+ _.bindAll( this, 'close' );
+
+ // If the available menu items panel is open and the customize controls are
+ // interacted with (other than an item being deleted), then close the
+ // available menu items panel. Also close on back button click.
+ $( '#customize-controls, .customize-section-back' ).on( 'click keydown', function( e ) {
+ var isDeleteBtn = $( e.target ).is( '.item-delete, .item-delete *' ),
+ isAddNewBtn = $( e.target ).is( '.add-new-menu-item, .add-new-menu-item *' );
+ if ( $( 'body' ).hasClass( 'adding-menu-items' ) && ! isDeleteBtn && ! isAddNewBtn ) {
+ self.close();
+ }
+ } );
+
+ this.$el.on( 'input', '#custom-menu-item-name.invalid, #custom-menu-item-url.invalid', function() {
+ $( this ).removeClass( 'invalid' );
+ });
+
+ // Load available items if it looks like we'll need them.
+ api.panel( 'nav_menus' ).container.bind( 'expanded', function() {
+ if ( ! self.rendered ) {
+ self.initList();
+ self.rendered = true;
+ }
+ });
+
+ // Load more items.
+ this.sectionContent.scroll( function() {
+ var totalHeight = self.$el.find( '.accordion-section.open .accordion-section-content' ).prop( 'scrollHeight' ),
+ visibleHeight = self.$el.find( '.accordion-section.open' ).height();
+ if ( ! self.loading && $( this ).scrollTop() > 3 / 4 * totalHeight - visibleHeight ) {
+ var type = $( this ).data( 'type' ),
+ obj_type = $( this ).data( 'obj_type' );
+ if ( 'search' === type ) {
+ if ( self.searchTerm ) {
+ self.doSearch( self.pages.search );
+ }
+ } else {
+ self.loadItems( type, obj_type );
+ }
+ }
+ });
+
+ // Close the panel if the URL in the preview changes
+ api.previewer.bind( 'url', this.close );
+ },
+
+ // Search input change handler.
+ search: function( event ) {
+ if ( ! event ) {
+ return;
+ }
+ // Manual accordion-opening behavior.
+ if ( this.searchTerm && ! $( '#available-menu-items-search' ).hasClass( 'open' ) ) {
+ $( '#available-menu-items .accordion-section-content' ).slideUp( 'fast' );
+ $( '#available-menu-items-search .accordion-section-content' ).slideDown( 'fast' );
+ $( '#available-menu-items .accordion-section.open' ).removeClass( 'open' );
+ $( '#available-menu-items-search' ).addClass( 'open' );
+ }
+ if ( '' === event.target.value ) {
+ $( '#available-menu-items-search' ).removeClass( 'open' );
+ }
+ if ( this.searchTerm === event.target.value ) {
+ return;
+ }
+ this.searchTerm = event.target.value;
+ this.pages.search = 1;
+ this.doSearch( 1 );
+ },
+
+ // Get search results.
+ doSearch: function( page ) {
+ var self = this, params,
+ $section = $( '#available-menu-items-search' ),
+ $content = $section.find( '.accordion-section-content' ),
+ itemTemplate = wp.template( 'available-menu-item' );
+
+ if ( self.currentRequest ) {
+ self.currentRequest.abort();
+ }
+
+ if ( page < 0 ) {
+ return;
+ } else if ( page > 1 ) {
+ $section.addClass( 'loading-more' );
+ } else if ( '' === self.searchTerm ) {
+ $content.html( '' );
+ return;
+ }
+
+ $section.addClass( 'loading' );
+ self.loading = true;
+ params = {
+ 'customize-menus-nonce': api.Menus.data.nonce,
+ 'wp_customize': 'on',
+ 'search': self.searchTerm,
+ 'page': page
+ };
+
+ self.currentRequest = wp.ajax.post( 'search-available-menu-items-customizer', params );
+
+ self.currentRequest.done(function( data ) {
+ var items;
+ if ( 1 === page ) {
+ // Clear previous results as it's a new search.
+ $content.empty();
+ }
+ $section.removeClass( 'loading loading-more' );
+ $section.addClass( 'open' );
+ self.loading = false;
+ items = new api.Menus.AvailableItemCollection( data.items );
+ self.collection.add( items.models );
+ items.each( function( menuItem ) {
+ $content.append( itemTemplate( menuItem.attributes ) );
+ } );
+ if ( 20 > items.length ) {
+ self.pages.search = -1; // Up to 20 posts and 20 terms in results, if <20, no more results for either.
+ } else {
+ self.pages.search = self.pages.search + 1;
+ }
+ });
+
+ self.currentRequest.fail(function( data ) {
+ $content.empty().append( $( '
' ).text( data.message ) );
+ wp.a11y.speak( data.message );
+ self.pages.search = -1;
+ });
+
+ self.currentRequest.always(function() {
+ $section.removeClass( 'loading loading-more' );
+ self.loading = false;
+ self.currentRequest = null;
+ });
+ },
+
+ // Render the individual items.
+ initList: function() {
+ var self = this;
+
+ // Render the template for each item by type.
+ _.each( api.Menus.data.itemTypes, function( typeObjects, type ) {
+ _.each( typeObjects, function( typeObject, slug ) {
+ if ( 'postTypes' === type ) {
+ type = 'post_type';
+ } else if ( 'taxonomies' === type ) {
+ type = 'taxonomy';
+ }
+ self.pages[ slug ] = 0; // @todo should prefix with type
+ self.loadItems( slug, type );
+ } );
+ } );
+ },
+
+ // Load available menu items.
+ loadItems: function( type, obj_type ) {
+ var self = this, params, request, itemTemplate;
+ itemTemplate = wp.template( 'available-menu-item' );
+
+ if ( 0 > self.pages[type] ) {
+ return;
+ }
+ $( '#available-menu-items-' + type + ' .accordion-section-title' ).addClass( 'loading' );
+ self.loading = true;
+ params = {
+ 'customize-menus-nonce': api.Menus.data.nonce,
+ 'wp_customize': 'on',
+ 'type': type,
+ 'obj_type': obj_type,
+ 'page': self.pages[ type ]
+ };
+ request = wp.ajax.post( 'load-available-menu-items-customizer', params );
+
+ request.done(function( data ) {
+ var items, typeInner;
+ items = data.items;
+ if ( 0 === items.length ) {
+ self.pages[ type ] = -1;
+ return;
+ }
+ items = new api.Menus.AvailableItemCollection( items ); // @todo Why is this collection created and then thrown away?
+ self.collection.add( items.models );
+ typeInner = $( '#available-menu-items-' + type + ' .accordion-section-content' );
+ items.each(function( menu_item ) {
+ typeInner.append( itemTemplate( menu_item.attributes ) );
+ });
+ self.pages[ type ] = self.pages[ type ] + 1;
+ });
+ request.fail(function( data ) {
+ if ( typeof console !== 'undefined' && console.error ) {
+ console.error( data );
+ }
+ });
+ request.always(function() {
+ $( '#available-menu-items-' + type + ' .accordion-section-title' ).removeClass( 'loading' );
+ self.loading = false;
+ });
+ },
+
+ // Adjust the height of each section of items to fit the screen.
+ itemSectionHeight: function() {
+ var sections, totalHeight, accordionHeight, diff;
+ totalHeight = window.innerHeight;
+ sections = this.$el.find( '.accordion-section-content' );
+ accordionHeight = 46 * ( 1 + sections.length ) - 16; // Magic numbers.
+ diff = totalHeight - accordionHeight;
+ if ( 120 < diff && 290 > diff ) {
+ sections.css( 'max-height', diff );
+ } else if ( 120 >= diff ) {
+ this.$el.addClass( 'allow-scroll' );
+ }
+ },
+
+ // Highlights a menu item.
+ select: function( menuitemTpl ) {
+ this.selected = $( menuitemTpl );
+ this.selected.siblings( '.menu-item-tpl' ).removeClass( 'selected' );
+ this.selected.addClass( 'selected' );
+ },
+
+ // Highlights a menu item on focus.
+ focus: function( event ) {
+ this.select( $( event.currentTarget ) );
+ },
+
+ // Submit handler for keypress and click on menu item.
+ _submit: function( event ) {
+ // Only proceed with keypress if it is Enter or Spacebar
+ if ( 'keypress' === event.type && ( 13 !== event.which && 32 !== event.which ) ) {
+ return;
+ }
+
+ this.submit( $( event.currentTarget ) );
+ },
+
+ // Adds a selected menu item to the menu.
+ submit: function( menuitemTpl ) {
+ var menuitemId, menu_item;
+
+ if ( ! menuitemTpl ) {
+ menuitemTpl = this.selected;
+ }
+
+ if ( ! menuitemTpl || ! this.currentMenuControl ) {
+ return;
+ }
+
+ this.select( menuitemTpl );
+
+ menuitemId = $( this.selected ).data( 'menu-item-id' );
+ menu_item = this.collection.findWhere( { id: menuitemId } );
+ if ( ! menu_item ) {
+ return;
+ }
+
+ this.currentMenuControl.addItemToMenu( menu_item.attributes );
+
+ $( menuitemTpl ).find( '.menu-item-handle' ).addClass( 'item-added' );
+ },
+
+ // Submit handler for keypress and click on custom menu item.
+ _submitLink: function( event ) {
+ // Only proceed with keypress if it is Enter.
+ if ( 'keypress' === event.type && 13 !== event.which ) {
+ return;
+ }
+
+ this.submitLink();
+ },
+
+ // Adds the custom menu item to the menu.
+ submitLink: function() {
+ var menuItem,
+ itemName = $( '#custom-menu-item-name' ),
+ itemUrl = $( '#custom-menu-item-url' );
+
+ if ( ! this.currentMenuControl ) {
+ return;
+ }
+
+ if ( '' === itemName.val() ) {
+ itemName.addClass( 'invalid' );
+ return;
+ } else if ( '' === itemUrl.val() || 'http://' === itemUrl.val() ) {
+ itemUrl.addClass( 'invalid' );
+ return;
+ }
+
+ menuItem = {
+ 'title': itemName.val(),
+ 'url': itemUrl.val(),
+ 'type': 'custom',
+ 'type_label': api.Menus.data.l10n.custom_label,
+ 'object': ''
+ };
+
+ this.currentMenuControl.addItemToMenu( menuItem );
+
+ // Reset the custom link form.
+ itemUrl.val( 'http://' );
+ itemName.val( '' );
+ },
+
+ // Opens the panel.
+ open: function( menuControl ) {
+ this.currentMenuControl = menuControl;
+
+ this.itemSectionHeight();
+
+ $( 'body' ).addClass( 'adding-menu-items' );
+
+ // Collapse all controls.
+ _( this.currentMenuControl.getMenuItemControls() ).each( function( control ) {
+ control.collapseForm();
+ } );
+
+ this.$el.find( '.selected' ).removeClass( 'selected' );
+
+ this.$search.focus();
+ },
+
+ // Closes the panel
+ close: function( options ) {
+ options = options || {};
+
+ if ( options.returnFocus && this.currentMenuControl ) {
+ this.currentMenuControl.container.find( '.add-new-menu-item' ).focus();
+ }
+
+ this.currentMenuControl = null;
+ this.selected = null;
+
+ $( 'body' ).removeClass( 'adding-menu-items' );
+ $( '#available-menu-items .menu-item-handle.item-added' ).removeClass( 'item-added' );
+
+ this.$search.val( '' );
+ },
+
+ // Add keyboard accessiblity to the panel
+ keyboardAccessible: function( event ) {
+ var isEnter = ( 13 === event.which ),
+ isEsc = ( 27 === event.which ),
+ isDown = ( 40 === event.which ),
+ isUp = ( 38 === event.which ),
+ isBackTab = ( 9 === event.which && event.shiftKey ),
+ selected = null,
+ firstVisible = this.$el.find( '> .menu-item-tpl:visible:first' ),
+ lastVisible = this.$el.find( '> .menu-item-tpl:visible:last' ),
+ isSearchFocused = $( event.target ).is( this.$search );
+
+ if ( isDown || isUp ) {
+ if ( isDown ) {
+ if ( isSearchFocused ) {
+ selected = firstVisible;
+ } else if ( this.selected && 0 !== this.selected.nextAll( '.menu-item-tpl:visible' ).length ) {
+ selected = this.selected.nextAll( '.menu-item-tpl:visible:first' );
+ }
+ } else if ( isUp ) {
+ if ( isSearchFocused ) {
+ selected = lastVisible;
+ } else if ( this.selected && 0 !== this.selected.prevAll( '.menu-item-tpl:visible' ).length ) {
+ selected = this.selected.prevAll( '.menu-item-tpl:visible:first' );
+ }
+ }
+
+ this.select( selected );
+
+ if ( selected ) {
+ selected.focus();
+ } else {
+ this.$search.focus();
+ }
+
+ return;
+ }
+
+ // If enter pressed but nothing entered, don't do anything
+ if ( isEnter && ! this.$search.val() ) {
+ return;
+ }
+
+ if ( isSearchFocused && isBackTab ) {
+ this.currentMenuControl.container.find( '.add-new-menu-item' ).focus();
+ event.preventDefault(); // Avoid additional back-tab.
+ } else if ( isEsc ) {
+ this.close( { returnFocus: true } );
+ }
+ }
+ });
+
+ /**
+ * wp.customize.Menus.MenusPanel
+ *
+ * Customizer panel for menus. This is used only for screen options management.
+ * Note that 'menus' must match the WP_Customize_Menu_Panel::$type.
+ *
+ * @constructor
+ * @augments wp.customize.Panel
+ */
+ api.Menus.MenusPanel = api.Panel.extend({
+
+ attachEvents: function() {
+ api.Panel.prototype.attachEvents.call( this );
+
+ var panel = this,
+ panelMeta = panel.container.find( '.panel-meta' ),
+ help = panelMeta.find( '.customize-help-toggle' ),
+ content = panelMeta.find( '.customize-panel-description' ),
+ options = $( '#screen-options-wrap' ),
+ button = panelMeta.find( '.customize-screen-options-toggle' );
+ button.on( 'click', function() {
+ // Hide description
+ if ( content.not( ':hidden' ) ) {
+ content.slideUp( 'fast' );
+ help.attr( 'aria-expanded', 'false' );
+ }
+
+ if ( 'true' === button.attr( 'aria-expanded' ) ) {
+ button.attr( 'aria-expanded', 'false' );
+ panelMeta.removeClass( 'open' );
+ panelMeta.removeClass( 'active-menu-screen-options' );
+ options.slideUp( 'fast' );
+ } else {
+ button.attr( 'aria-expanded', 'true' );
+ panelMeta.addClass( 'open' );
+ panelMeta.addClass( 'active-menu-screen-options' );
+ options.slideDown( 'fast' );
+ }
+
+ return false;
+ } );
+
+ // Help toggle
+ help.on( 'click', function() {
+ if ( 'true' === button.attr( 'aria-expanded' ) ) {
+ button.attr( 'aria-expanded', 'false' );
+ help.attr( 'aria-expanded', 'true' );
+ panelMeta.addClass( 'open' );
+ panelMeta.removeClass( 'active-menu-screen-options' );
+ options.slideUp( 'fast' );
+ content.slideDown( 'fast' );
+ }
+ } );
+ },
+
+ /**
+ * Show/hide/save screen options (columns). From common.js.
+ */
+ ready: function() {
+ var panel = this;
+ this.container.find( '.hide-column-tog' ).click( function() {
+ var $t = $( this ), column = $t.val();
+ if ( $t.prop( 'checked' ) ) {
+ panel.checked( column );
+ } else {
+ panel.unchecked( column );
+ }
+
+ panel.saveManageColumnsState();
+ });
+ this.container.find( '.hide-column-tog' ).each( function() {
+ var $t = $( this ), column = $t.val();
+ if ( $t.prop( 'checked' ) ) {
+ panel.checked( column );
+ } else {
+ panel.unchecked( column );
+ }
+ });
+ },
+
+ saveManageColumnsState: function() {
+ var hidden = this.hidden();
+ $.post( wp.ajax.settings.url, {
+ action: 'hidden-columns',
+ hidden: hidden,
+ screenoptionnonce: $( '#screenoptionnonce' ).val(),
+ page: 'nav-menus'
+ });
+ },
+
+ checked: function( column ) {
+ this.container.addClass( 'field-' + column + '-active' );
+ },
+
+ unchecked: function( column ) {
+ this.container.removeClass( 'field-' + column + '-active' );
+ },
+
+ hidden: function() {
+ this.hidden = function() {
+ return $( '.hide-column-tog' ).not( ':checked' ).map( function() {
+ var id = this.id;
+ return id.substring( id, id.length - 5 );
+ }).get().join( ',' );
+ };
+ }
+ } );
+
+ /**
+ * wp.customize.Menus.MenuSection
+ *
+ * Customizer section for menus. This is used only for lazy-loading child controls.
+ * Note that 'nav_menu' must match the WP_Customize_Menu_Section::$type.
+ *
+ * @constructor
+ * @augments wp.customize.Section
+ */
+ api.Menus.MenuSection = api.Section.extend({
+
+ /**
+ * @since Menu Customizer 0.3
+ *
+ * @param {String} id
+ * @param {Object} options
+ */
+ initialize: function( id, options ) {
+ var section = this;
+ api.Section.prototype.initialize.call( section, id, options );
+ section.deferred.initSortables = $.Deferred();
+ },
+
+ /**
+ *
+ */
+ ready: function() {
+ var section = this;
+
+ if ( 'undefined' === typeof section.params.menu_id ) {
+ throw new Error( 'params.menu_id was not defined' );
+ }
+
+ /*
+ * Since newly created sections won't be registered in PHP, we need to prevent the
+ * preview's sending of the activeSections to result in this control
+ * being deactivated when the preview refreshes. So we can hook onto
+ * the setting that has the same ID and its presence can dictate
+ * whether the section is active.
+ */
+ section.active.validate = function() {
+ if ( ! api.has( section.id ) ) {
+ return false;
+ }
+ return !! api( section.id ).get();
+ };
+
+ section.populateControls();
+
+ section.navMenuLocationSettings = {};
+ section.assignedLocations = new api.Value( [] );
+
+ api.each(function( setting, id ) {
+ var matches = id.match( /^nav_menu_locations\[(.+?)]/ );
+ if ( matches ) {
+ section.navMenuLocationSettings[ matches[1] ] = setting;
+ setting.bind( function() {
+ section.refreshAssignedLocations();
+ });
+ }
+ });
+
+ section.assignedLocations.bind(function( to ) {
+ section.updateAssignedLocationsInSectionTitle( to );
+ });
+
+ section.refreshAssignedLocations();
+ },
+
+ populateControls: function() {
+ var section = this, menuNameControlId, menuControl, menuNameControl;
+
+ // Add the control for managing the menu name.
+ menuNameControlId = section.id + '[name]';
+ menuNameControl = api.control( menuNameControlId );
+ if ( ! menuNameControl ) {
+ menuNameControl = new api.controlConstructor.nav_menu_name( menuNameControlId, {
+ params: {
+ type: 'nav_menu_name',
+ content: '', // @todo core should do this for us
+ label: '',
+ active: true,
+ section: section.id,
+ priority: 0,
+ settings: {
+ 'default': section.id
+ }
+ }
+ } );
+ api.control.add( menuNameControl.id, menuNameControl );
+ menuNameControl.active.set( true );
+ }
+
+ // Add the menu control.
+ menuControl = api.control( section.id );
+ if ( ! menuControl ) {
+ menuControl = new api.controlConstructor.nav_menu( section.id, {
+ params: {
+ type: 'nav_menu',
+ content: '', // @todo core should do this for us
+ section: section.id,
+ priority: 999,
+ active: true,
+ settings: {
+ 'default': section.id
+ },
+ menu_id: section.params.menu_id
+ }
+ } );
+ api.control.add( menuControl.id, menuControl );
+ menuControl.active.set( true );
+ }
+
+ },
+
+ /**
+ *
+ */
+ refreshAssignedLocations: function() {
+ var section = this,
+ menuTermId = section.params.menu_id,
+ currentAssignedLocations = [];
+ _.each( section.navMenuLocationSettings, function( setting, themeLocation ) {
+ if ( setting() === menuTermId ) {
+ currentAssignedLocations.push( themeLocation );
+ }
+ });
+ section.assignedLocations.set( currentAssignedLocations );
+ },
+
+ /**
+ * @param {array} themeLocations
+ */
+ updateAssignedLocationsInSectionTitle: function( themeLocations ) {
+ var section = this,
+ $title;
+
+ $title = section.container.find( '.accordion-section-title:first' );
+ $title.find( '.menu-in-location' ).remove();
+ _.each( themeLocations, function( themeLocation ) {
+ var $label = $( '' );
+ $label.text( api.Menus.data.l10n.menuLocation.replace( '%s', themeLocation ) );
+ $title.append( $label );
+ });
+
+ section.container.toggleClass( 'assigned-to-menu-location', 0 !== themeLocations.length );
+
+ },
+
+ onChangeExpanded: function( expanded, args ) {
+ var section = this;
+
+ if ( expanded ) {
+ wpNavMenu.menuList = section.container.find( '.accordion-section-content:first' );
+ wpNavMenu.targetList = wpNavMenu.menuList;
+
+ // Add attributes needed by wpNavMenu
+ $( '#menu-to-edit' ).removeAttr( 'id' );
+ wpNavMenu.menuList.attr( 'id', 'menu-to-edit' ).addClass( 'menu' );
+
+ _.each( api.section( section.id ).controls(), function( control ) {
+ if ( 'nav_menu_item' === control.params.type ) {
+ control.actuallyEmbed();
+ }
+ } );
+
+ if ( 'resolved' !== section.deferred.initSortables.state() ) {
+ wpNavMenu.initSortables(); // Depends on menu-to-edit ID being set above.
+ section.deferred.initSortables.resolve( wpNavMenu.menuList ); // Now MenuControl can extend the sortable.
+
+ // @todo Note that wp.customize.reflowPaneContents() is debounced, so this immediate change will show a slight flicker while priorities get updated.
+ api.control( 'nav_menu[' + String( section.params.menu_id ) + ']' ).reflowMenuItems();
+ }
+ }
+ api.Section.prototype.onChangeExpanded.call( section, expanded, args );
+ }
+ });
+
+ /**
+ * wp.customize.Menus.NewMenuSection
+ *
+ * Customizer section for new menus.
+ * Note that 'new_menu' must match the WP_Customize_New_Menu_Section::$type.
+ *
+ * @constructor
+ * @augments wp.customize.Section
+ */
+ api.Menus.NewMenuSection = api.Section.extend({
+
+ /**
+ * Add behaviors for the accordion section.
+ *
+ * @since Menu Customizer 0.3
+ */
+ attachEvents: function() {
+ var section = this;
+ this.container.on( 'click', '.add-menu-toggle', function() {
+ if ( section.expanded() ) {
+ section.collapse();
+ } else {
+ section.expand();
+ }
+ });
+ },
+
+ /**
+ * Update UI to reflect expanded state.
+ *
+ * @since 4.1.0
+ *
+ * @param {Boolean} expanded
+ */
+ onChangeExpanded: function( expanded ) {
+ var section = this,
+ button = section.container.find( '.add-menu-toggle' ),
+ content = section.container.find( '.new-menu-section-content' ),
+ customizer = section.container.closest( '.wp-full-overlay-sidebar-content' );
+ if ( expanded ) {
+ button.addClass( 'open' );
+ content.slideDown( 'fast', function() {
+ customizer.scrollTop( customizer.height() );
+ });
+ } else {
+ button.removeClass( 'open' );
+ content.slideUp( 'fast' );
+ }
+ }
+ });
+
+ /**
+ * wp.customize.Menus.MenuLocationControl
+ *
+ * Customizer control for menu locations (rendered as a