Skip to content
This repository has been archived by the owner on Dec 30, 2024. It is now read-only.

Commit

Permalink
Fix inverted selection bug; remove extra console messages
Browse files Browse the repository at this point in the history
  • Loading branch information
JimTharioAmazon committed Apr 5, 2019
1 parent d8c5dfb commit 28cb2de
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
2 changes: 1 addition & 1 deletion html/js/app/mappers/nodes/mediaconnect.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ define(["jquery", "app/server", "app/connections", "app/regions", "app/model", "
return new Promise(function(resolve, reject) {
server.get(url + "/cached/mediaconnect-flow/" + regionName, api_key).then(function(flows) {
$.each(flows, function(index, cache_entry) {
console.log(cache_entry);
// console.log(cache_entry);
map_flow(cache_entry);
});
resolve();
Expand Down
9 changes: 6 additions & 3 deletions html/js/app/ui/selected_item_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,11 +209,14 @@ define(["jquery", "app/model", "app/ui/global_view", "app/channels", "app/ui/til
};

var tile_view_listener = function(name, members) {
if (tile_view.selected()) {
var selected = tile_view.selected();
if (selected === name) {
// show();
display_selected_tile(name, members);
} else {
display_no_selection();
} else if (selected) {
channels.retrieve_channel(selected).then((members) => {
display_selected_tile(selected, members);
});
}
};

Expand Down
10 changes: 6 additions & 4 deletions html/js/app/ui/tile_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ define(["jquery", "app/channels", "app/model", "app/ui/util", "app/events", "app

var selection_listener = function(name) {
toggle_tile(name);
// select(name);
};

var selected = function() {
Expand Down Expand Up @@ -83,12 +84,12 @@ define(["jquery", "app/channels", "app/model", "app/ui/util", "app/events", "app
};

var select = function(name) {
// query = `[data-channel-name][data-channel-name!='${name}']`;
var unselected_tiles = $(".selected-channel-tile");
unselected_tiles.removeClass("selected-channel-tile");
var query = `[data-channel-name='${name}']`;
var selected_tile = $(query);
selected_tile.addClass("selected-channel-tile");
query = `[data-channel-name][data-channel-name!='${name}']`;
var unselected_tiles = $(query);
unselected_tiles.removeClass("selected-channel-tile");
};

var unselect = function(name) {
Expand Down Expand Up @@ -240,6 +241,7 @@ define(["jquery", "app/channels", "app/model", "app/ui/util", "app/events", "app
var name = channel_name;
var members = channel_members;
return function() {
selection_listener(name, members);
click_listeners.forEach(function(f) {
f(name, members);
});
Expand Down Expand Up @@ -485,7 +487,7 @@ define(["jquery", "app/channels", "app/model", "app/ui/util", "app/events", "app
schedule_interval();
event_alerts.add_callback(event_alert_callback);
alarms.add_callback(alarm_callback);
add_selection_callback(selection_listener);
// add_selection_callback(selection_listener);
});

return {
Expand Down

0 comments on commit 28cb2de

Please sign in to comment.