Show "Select directory ..." button in web view
This commit is contained in:
parent
e59a80c0f6
commit
ec02a9e483
|
@ -251,11 +251,15 @@ void WebPage::injectJavaScripts(bool ok)
|
||||||
{
|
{
|
||||||
Q_UNUSED(ok)
|
Q_UNUSED(ok)
|
||||||
// show folder path selection when double-clicking input
|
// show folder path selection when double-clicking input
|
||||||
injectJavaScript(QStringLiteral("jQuery('#folderPath').dblclick(function(event) {"
|
injectJavaScript(QStringLiteral("var button = jQuery('<button type=\"button\" class=\"btn btn-sm\" "
|
||||||
" if (event.target && !event.target.getAttribute('readonly')) {"
|
"style=\"float: right;\">Select directory ...</button>');"
|
||||||
|
"button.click(function(event) {"
|
||||||
|
" if (!document.getElementById('folderPath').getAttribute('readonly')) {"
|
||||||
" console.log('nativeInterface.showFolderPathSelection: ' + event.target.value);"
|
" console.log('nativeInterface.showFolderPathSelection: ' + event.target.value);"
|
||||||
" }"
|
" }"
|
||||||
"});"));
|
"});"
|
||||||
|
"var help = jQuery('#folderPath + * + .help-block');"
|
||||||
|
"help.prepend(button);"));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
|
Loading…
Reference in New Issue