Skip to content

Commit

Permalink
added confirmation panel on disable owner
Browse files Browse the repository at this point in the history
  • Loading branch information
dshuffma-ibm committed Jul 23, 2017
1 parent 226cfa6 commit 1c44715
Show file tree
Hide file tree
Showing 9 changed files with 60 additions and 8 deletions.
2 changes: 1 addition & 1 deletion public/css/main.min.css

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions public/js/startup.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ $(document).on('ready', function () {
};
console.log('[startup] sending register msg');
ws.send(JSON.stringify(obj));
$(this).prev('button').html('Next Step');
});

// show loading spinner
Expand Down
7 changes: 6 additions & 1 deletion public/js/ui_building.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,17 @@ function build_user_panels(data) {

console.log('[ui] building owner panel ' + data[i].id);

let disableHtml = '';
if (data[i].company === escapeHtml(bag.marble_company)) {
disableHtml = '<span class="fa fa-trash disableOwner" title="Disable Owner"></span>';
}

html += `<div id="user` + i + `wrap" username="` + data[i].username + `" company="` + data[i].company +
`" owner_id="` + data[i].id + `" class="marblesWrap ` + colorClass + `">
<div class="legend" style="` + size_user_name(data[i].username) + `">
` + toTitleCase(data[i].username) + `
<span class="fa fa-thumb-tack marblesFix" title="Never Hide Owner"></span>
<span class="fa fa-trash disableOwner" title="Disable Owner"></span>
` + disableHtml + `
</div>
<div class="innerMarbleWrap"><i class="fa fa-plus addMarble"></i></div>
<div class="noMarblesMsg hint">No marbles</div>
Expand Down
17 changes: 14 additions & 3 deletions public/js/ui_events.js
Original file line number Diff line number Diff line change
Expand Up @@ -279,14 +279,25 @@ $(document).on('ready', function () {
$('#leftEverything').fadeIn();
});

// disable the marble owner
let selectedOwner = null;
// show dialog to confirm if they want to disable the marble owner
$(document).on('click', '.disableOwner', function () {
$('#disableOwnerWrap, #tint').fadeIn();
selectedOwner = $(this).parents('.marblesWrap');
});

// disable the marble owner
$('#removeOwner').click(function () {
var obj = {
type: 'disable_owner',
owner_id: $(this).parents('.marblesWrap').attr('owner_id')
owner_id: selectedOwner.attr('owner_id')
};
ws.send(JSON.stringify(obj));
$(this).parents('.marblesWrap').css('opacity', 0.4);
selectedOwner.css('opacity', 0.4);
});

$('.closeDisableOwner, #removeOwner').click(function () {
$('#disableOwnerWrap, #tint').fadeOut();
});
});

Expand Down
4 changes: 2 additions & 2 deletions scss/3_global.scss
Original file line number Diff line number Diff line change
Expand Up @@ -680,12 +680,12 @@ $marble_left: 0;
margin-top: 15px;
padding-top: 15px;
}
#closeStartUp, #closeTxStoryPos, #closeSettings, #closeCreate{
#closeStartUp, #closeTxStoryPos, #closeSettings, #closeCreate, #closePos{
position: absolute;
right: 15px;
top: 15px;
}
#closeStartUp:hover, #closeTxStoryPos:hover, #closeSettings:hover, #closeCreate:hover{
#closeStartUp:hover, #closeTxStoryPos:hover, #closeSettings:hover, #closeCreate:hover, #closePos:hover{
color: $hi_color1;
cursor: pointer;
}
Expand Down
11 changes: 11 additions & 0 deletions scss/disable_owner.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#disableOwnerWrap{
display: none;
position: absolute;
top: 200px;
left: calc(50% - 250px);
width: 500px;
background: #343d48;
padding: 20px 40px;
border-radius: 3px;
z-index: 1100;
}
3 changes: 3 additions & 0 deletions views/marbles.pug
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ block content

// --------------- Settings Panel
include ./panel_settings.pug

// --------------- Disable Owner Panel
include ./panel_disable_owner.pug

block footer
include ./template/blockchain.pug
21 changes: 21 additions & 0 deletions views/panel_disable_owner.pug
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#disableOwnerWrap
span.fa.fa-close.closeDisableOwner#closePos

h2 Remove

br
br

span Do you want to archive this marble owner?

br
br

span Their marbles will also be archived.

br
br

button.closeDisableOwner(style="float:left;") Nope
span &nbsp;&nbsp;
button(style="float:right;")#removeOwner Yep
2 changes: 1 addition & 1 deletion views/panel_startup.pug
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@
span.tooltiptext Enter the names of the marble owners you want created. Seperate them by commas.

.successStep Step 4 Complete
button.nextStep(nextstepid="step5" style="display: inline-block") Next Step
button.nextStep(nextstepid="step5" style="display: inline-block") Skip Step
button.runStep(stepid="step4" nextstepid="step5")#registerOwners Create

//----------------- Step 5 Content [Finished]
Expand Down

0 comments on commit 1c44715

Please sign in to comment.