Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #21323: Focus change on the firest caracter in input box for method's condition #4566

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ showMethodTab model method parentId call uiInfo=
, name "class_context"
, class "form-control"
, rows 1
, id "advanced"
, id "class_context"
, value (conditionStr condition)
, readonly True
-- to deactivate plugin "Grammarly" or "Language Tool" from
Expand Down Expand Up @@ -478,6 +478,7 @@ callBody model ui techniqueUi call pid =
|> appendChild removeIcon
condition = element "div"
|> addClass "method-condition flex-form"
|> addClassConditional "hidden" (call.condition.os == Nothing && call.condition.advanced == "")
|> appendChildList
[ element "label"
|> appendText "Condition:"
Expand All @@ -491,22 +492,26 @@ callBody model ui techniqueUi call pid =
Nothing -> ""
methodName = case ui.mode of
Opened -> element "div"
|> addClass "method-name"
|> appendChild
( element "div"
|> addClass "component-name-wrapper"
|> appendChildList
[ element "div"
|> addClass "title-input-name"
|> appendText "Name"
, element "div"
|> addClass "gm-label-name"
|> appendText method.name
|> addActionStopPropagation ("mouseover" , HoverMethod Nothing)
, element "div"
|> addClass "form-group"
|> appendChildList
[ element "div"
|> addClass "title-input-name"
|> appendText "Name"
, element "input"
|> addAttributeList [ readonly (not model.hasWriteRights), stopPropagationOn "mousedown" (Json.Decode.succeed (DisableDragDrop, True)), onFocus DisableDragDrop, type_ "text", name "component", style "width" "100%", class "form-control", value call.component, placeholder "Enter a component name" ]
|> addInputHandler (\s -> MethodCallModified (Call pid {call | component = s }))
]
]
|> appendChild
(element "input"
|> addAttributeList [ readonly (not model.hasWriteRights), stopPropagationOn "mousedown" (Json.Decode.succeed (DisableDragDrop, True)), onFocus DisableDragDrop, type_ "text", name "component", style "width" "100%", class "form-control", value call.component, placeholder "Enter a component name" ]
|> addInputHandler (\s -> MethodCallModified (Call pid {call | component = s })))
)
Closed -> element "div"
|> addClass "method-name"
Expand Down Expand Up @@ -557,7 +562,7 @@ callBody model ui techniqueUi call pid =
|> Dom.appendChildList
[ dragElem
, element "div"
|> addClass ("method-info " ++ shoudHoveredMethod)
|> addClass ("method-info" ++ shoudHoveredMethod)
|> addActionStopPropagation ("mouseleave" , HoverMethod Nothing)
|> addClassConditional ("closed") (ui.mode == Closed)
|> addAction ("click", UIMethodAction call.id {ui | mode = Opened})
Expand All @@ -578,10 +583,11 @@ callBody model ui techniqueUi call pid =
]
, element "span" |> appendText " "
]

, element "div"
|> addClass "flex-column"
|> addAction ("click", UIMethodAction call.id {ui | mode = Opened})
|> appendChildConditional condition (call.condition.os /= Nothing || call.condition.advanced /= "")
|> appendChild condition
|> appendChild methodName
--|> appendChild methodNameId
|> appendChildConditional methodContent (ui.mode == Closed)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -898,7 +898,10 @@ button.btn.clipboard:hover {
}

.method-details .form-group{
margin-bottom: 2px;
margin-bottom: 6px;
}
.method-details .form-group .form-group:last-child{
margin-bottom: 0;
}
.method-details textarea + ul.list-unstyled{
min-height: 19px;
Expand Down Expand Up @@ -1075,7 +1078,7 @@ ul li.hide-method {
}
.method .method-condition{
word-break: break-word;
padding-right: 50px;
padding-right: 300px;
}
.name-content {
cursor: text;
Expand Down Expand Up @@ -1111,8 +1114,9 @@ ul li.hide-method {
background-color: #8fb92a;
}

.method .method-condition ~ div:before,
.method .method-condition ~ label:before {
.method .method-info.closed .method-condition:not(.hidden) ~ div:before,
.method .method-info .method-condition:not(.hidden) ~ div:not(.method-name):before,
.method .method-condition:not(.hidden) ~ label:before {
content: "";
position: absolute;
top: 0;
Expand All @@ -1121,7 +1125,7 @@ ul li.hide-method {
width: 3px;
background-color: #337ab7;
}
.method .method-condition ~ div{
.method .method-info.closed .method-condition ~ div{
padding-left: 10px;
}
.method .method-name {
Expand Down Expand Up @@ -1151,13 +1155,18 @@ ul li.hide-method {
display: inline-block;
color: #777;
cursor: pointer;
margin-right: 4px;
}
.label-value {
cursor: text;
}
.method-condition > label{
display: inline-block;
color: #337ab7;
margin: 0 4px 0 10px;
}
.method-info.closed .method-condition > label{
margin-left: 0;
}
.method-param > .form-control,
.method-condition > .form-control{
Expand Down Expand Up @@ -1527,15 +1536,13 @@ ul li.hide-method {
margin-left:10px;
}
.title-input-name {
position: absolute;
margin-top: 14px;
font-size: 14px;
font-weight: bold;
margin-top: 14px;
}
.gm-label-name {
font-size:11px;
opacity:0.9;
margin-top : -2px;
display: inline-block;
padding-left: 10px;
padding-right: 10px;
Expand All @@ -1546,9 +1553,19 @@ ul li.hide-method {
line-height: 25px;
border-radius: 0 0 5px 5px;
z-index:10;
float:right;
margin-bottom:10px;
margin-right:80px;
margin: 0;
position: absolute;
top: -16px;
right: 80px;
}
.method-info .method-condition:not(.hidden) + .method-name .gm-label-name{
top: -24px;
}
.method-info:not(.closed) .method-condition:not(.hidden) + .method-name .gm-label-name{
top: -36px;
}
.method-info.closed .method-condition.hidden + .method-name .gm-label-name{
top: -2px;
}
.reporting-checkbox {
margin-left: 5px;
Expand Down