diff --git a/static/compiler.js b/static/compiler.js index b037e453b..fe5eaa9f7 100644 --- a/static/compiler.js +++ b/static/compiler.js @@ -1041,6 +1041,11 @@ function Compiler(domRoot, origFilters, windowLocalPrefix, setSetting('leaderSlot', leaderSlot.id); } + // hide the close-slot icon if there will remain 1 slot + if (slots.length <= 2) { + domRoot.find('.slot .closeButton').hide() + } + // now safely delete: removeSetting('compiler'+slot.id); removeSetting('compilerOptions'+slot.id); @@ -1103,14 +1108,18 @@ function Compiler(domRoot, origFilters, windowLocalPrefix, slot.node.show(); slot.node.find('.closeButton').on('click', function(e) { console.log("[UI] User clicked on closeButton in slot "+slot.id); - if (slots.length > 1) { - var slotToDelete = getSlotById(slot.id); - deleteAndUnplaceSlot(slotToDelete); - } else { - console.log("[UI] It is useless to close the last compiler!"); - } + var slotToDelete = getSlotById(slot.id); + deleteAndUnplaceSlot(slotToDelete); }); + // show the close-slot icons if there will be more than 1 slot + if (slots.length == 1) { + domRoot.find('.slot .closeButton').hide() + } + if (slots.length == 2) { + domRoot.find('.slot .closeButton').show() + } + setPanelListSortable(); } @@ -1188,7 +1197,7 @@ function Compiler(domRoot, origFilters, windowLocalPrefix, function updateDiffButton(diff, className) { var slot = diff[className+'Slot']; - var diffSlotMenuNode = diff.node.find('.'+className+' .slot'); + var diffSlotMenuNode = diff.node.find('.'+className+' .slotName'); diffSlotMenuNode.text(slot.description()); } @@ -1227,7 +1236,7 @@ function Compiler(domRoot, origFilters, windowLocalPrefix, diff.node.find('.'+className+' li').remove(); for (var i = 0; i < slots.length; i++) { var elem = $('
  • ' + slots[i].description() + '
  • '); - diff.node.find('.'+className+' .slots').append(elem); + diff.node.find('.'+className+' .slotNameList').append(elem); (function (i) { elem.click(function () { // TODO: check if modifying diff with [] will survive to diff --git a/static/gcc.css b/static/gcc.css index 6a7d66d46..293202159 100644 --- a/static/gcc.css +++ b/static/gcc.css @@ -232,7 +232,7 @@ li.social { display: inline-block; } -.characterIcon { +.unselectable{ /* disable text selection on character icons * source : http://stackoverflow.com/a/9314458/4669135 */ -webkit-touch-callout: none; @@ -243,6 +243,11 @@ li.social { user-select: none; } +.characterIcon { + /* Show classical cursor when hovering */ + cursor: pointer; +} + .selectedCharacterIcon { color: #01DF01; font-size: 25px; @@ -259,9 +264,17 @@ li.social { .unicode-arrow { font-size: 25px; - padding: 10px; } +.unicodeCross { + overflow: visible; + font-weight: bold; + color: #B90000; + font-size: 20px; /* problem : it makes the panel header (title zone) bigger*/ + float: right; +} + + .diff-before-button { background-color: rgba(251,175,175,.7); } diff --git a/static/index.html b/static/index.html index 2dfe50d26..8b540b1f4 100644 --- a/static/index.html +++ b/static/index.html @@ -195,15 +195,15 @@
  • -
    Slot template (should *not* be visible)[X]
    -
    +
    Slot template (should *not* be visible)✖
    +
    - + - +
    -

    ☆

    +

    ☆

    ⇒ ⇒ ⇆ ⇆