Skip to content

Commit 1292daa

Browse files
committed
Complete first pass of the UI conversion to Backbone.
This commit continues in the pattern from the previous commit, removing the `buoy_dom_hooks` where they are no longer needed and converting each individual user interface element to a `Backbone.View` object. Notably: * Alert button names have been standardized across the codebase. * The `attachHandlers` method was replaced with Backbone constructors. * Bug in `class-buoy-alert.php` when scheduling Timed Alerts was fixed. * JSDoc syntax is now used thoroughly across the `alert.js` file. Yay! This isn't perfect yet. There are a few parts where the lack of a real `Backbone.Model` for our alerts are requiring some hacky things. But the purpose of this commit was to begin the migration to a Backbone-based structure as gradually as is sensible to do so. Models will come later.
1 parent 38e8217 commit 1292daa

File tree

7 files changed

+413
-277
lines changed

7 files changed

+413
-277
lines changed

buoy.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ var BUOY = (function () {
9292
* @return {number}
9393
*/
9494
var countIncidentMenuItems = function () {
95-
return jQuery(buoy_dom_hooks.menu_id).length;
95+
return jQuery('#wp-admin-bar-buoy-alerts-menu').length;
9696
};
9797

9898
return {

css/alerts.css

+4-4
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
padding-bottom: 0;
2424
}
2525

26-
.dashboard_page_buoy_activate_alert #custom-message-alert-btn,
27-
.dashboard_page_buoy_activate_alert #schedule-future-alert-btn,
26+
.dashboard_page_buoy_activate_alert #contextual-alert-button,
27+
.dashboard_page_buoy_activate_alert #timed-alert-button,
2828
.dashboard_page_buoy_activate_alert #immediate-alert-button {
2929
background: #d43f3a;
3030
margin: 10px 0;
@@ -51,8 +51,8 @@
5151
height: 75%;
5252
}
5353
.dashboard_page_buoy_activate_alert #immediate-alert-button img,
54-
.dashboard_page_buoy_activate_alert #custom-message-alert-btn img,
55-
.dashboard_page_buoy_activate_alert #schedule-future-alert-btn img {
54+
.dashboard_page_buoy_activate_alert #contextual-alert-button img,
55+
.dashboard_page_buoy_activate_alert #timed-alert-button img {
5656
height: 100%;
5757
max-height: calc(100% - 32px);
5858
max-width: 100%;

0 commit comments

Comments
 (0)