Skip to content

Commit

Permalink
Work in progress
Browse files Browse the repository at this point in the history
  • Loading branch information
RaphaelGauthier committed Jan 17, 2022
1 parent 1b6c681 commit 67e12e8
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,6 @@ type Msg =
| Notification (String -> Cmd Msg) String
| DisableDragDrop
| EnableDragDrop CallId
| ToggleDropdown String
| HoverMethod (Maybe CallId)

dragDropMessages : DragDrop.Messages Msg DragElement DropElement
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ port successNotification : String -> Cmd msg
port errorNotification : String -> Cmd msg
--port warnNotification : String -> Cmd msg
port infoNotification : String -> Cmd msg
port toggleDropdown : String -> Cmd msg
port pushUrl : String -> Cmd msg
port getUrl : () -> Cmd msg

Expand Down Expand Up @@ -850,8 +849,6 @@ update msg model =

Notification notif notifMsg ->
(model, notif notifMsg)
ToggleDropdown id ->
(model, toggleDropdown id)
DisableDragDrop ->
case model.mode of
Introduction -> (model, Cmd.none)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,21 +115,20 @@ showBlockTab model parentId block uiInfo techniqueUi =
|> addAttribute (for "OsCondition")
|> appendText "Operating system: "
, element "div"
|> addStyleList [ ("display", "inline-block"), ("width", "auto"), ("margin-left", "5px") ]
|> addClass "btn-group"
|> appendChildList
[ element "button"
|> addClass "btn btn-default dropdown-toggle"
|> addAttributeList
[ id "OsCondition" , attribute "data-toggle" "dropdown"
, attribute "aria-haspopup" "true", attribute "aria-expanded" "true"
, stopPropagationOn "mousedown" (Json.Decode.succeed (DisableDragDrop, True))
]
|> appendText ((osName condition.os) ++ " ")
|> appendChild (element "span" |> addClass"caret")
, element "ul"
|> addClass "dropdown-menu"
|> addAttribute (attribute "aria-labelledby" "OsCondition")
|> addStyle ("margin-left", "0px")
|> appendNodeList osLi
]
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,13 +164,15 @@ showMethodTab model method parentId call uiInfo=
div [class "form-group condition-form", id "os-form"] [
div [ class "form-inline" ] [
div [ class "form-group" ] [
label [ style "display" "inline-block", class "", for "OsCondition"] [ text "Operating system: " ]
, div [ style "display" "inline-block", style "width" "auto", style "margin-left" "5px",class "btn-group" ] [
button [ class "btn btn-default dropdown-toggle", id ("OsCondition-" ++ call.id.value), onClick (ToggleDropdown ("OsCondition-" ++ call.id.value)), stopPropagationOn "mousedown" (Json.Decode.succeed (DisableDragDrop, True)) ] [
text ((osName condition.os) ++ " ")
label [ style "display" "inline-block", for ("OsCondition-" ++ call.id.value)]
[ text "Operating system: " ]
, div [ style "display" "inline-block", class "btn-group" ]
[ button [ class "btn btn-default dropdown-toggle", id ("OsCondition-" ++ call.id.value), attribute "data-toggle" "dropdown"
, stopPropagationOn "mousedown" (Json.Decode.succeed (DisableDragDrop, True)) ]
[ text ((osName condition.os) ++ " ")
, span [ class "caret" ] []
]
, ul [ class "dropdown-menu", style "margin-left" "0px" ]
, ul [ class "dropdown-menu" ]
( List.map (\os ->
let
updatedCondition = {condition | os = os }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,13 +152,13 @@ showTechnique model technique origin ui =
]
]
, li [] [
a [ class "action-primary" , onClick Export] [ --ng-disabled="isNotSaved()" ng-click=""exportTechnique(selectedTechnique)
a [ class "action-primary" , onClick Export] [
text "Export "
, i [ class "fa fa-download"] []
]
]
, li [] [
a [ class "action-danger", onClick deleteAction ] [ --ng-disabled="isNotSaved()" ng-click="confirmPopup('Delete','Technique', deleteTechnique, selectedTechnique, selectedTechnique.name)"
a [ class "action-danger", onClick deleteAction ] [
text "Delete "
, i [ class "fa fa-times-circle"] []
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,6 @@
if (drafts === null) { drafts = {} }
app.ports.draftsResponse.send(drafts)
});
app.ports.toggleDropdown.subscribe(function(id) {
$("#"+id).dropdown('toggle')
});

app.ports.successNotification.subscribe(function(str) {
createSuccessNotification(str)
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@
*/

/* ===== GENERAL ===== */
#details{
padding-bottom: 100px;
}

.fade.modal-backdrop.in {
opacity: .3;
}
Expand All @@ -54,6 +58,15 @@
.ion.ion-edit {
font-size: 18px;
}

.condition-form label + .btn-group{
margin-left: 8px;
}
.condition-form .dropdown-toggle + .dropdown-menu{
margin-left: 0;
max-height: 250px;
overflow: auto;
}
ul.dropdown-menu {
padding: 0;
min-width: 170px;
Expand Down

0 comments on commit 67e12e8

Please sign in to comment.