mirror of
https://github.com/zhuzichu520/FluentUI.git
synced 2024-11-30 07:03:46 +08:00
update
This commit is contained in:
parent
25e385c06e
commit
a693db76c8
@ -60,11 +60,11 @@ FluWindow {
|
|||||||
event.accepted = false
|
event.accepted = false
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (event.urls.length !== 1) {
|
var url = getUrlByEvent(event)
|
||||||
|
if(url === ""){
|
||||||
event.accepted = false
|
event.accepted = false
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
var url = event.urls[0].toString()
|
|
||||||
var fileExtension = url.substring(url.lastIndexOf(".") + 1)
|
var fileExtension = url.substring(url.lastIndexOf(".") + 1)
|
||||||
if (fileExtension !== "qml") {
|
if (fileExtension !== "qml") {
|
||||||
event.accepted = false
|
event.accepted = false
|
||||||
@ -74,12 +74,24 @@ FluWindow {
|
|||||||
}
|
}
|
||||||
onDropped:
|
onDropped:
|
||||||
(event)=>{
|
(event)=>{
|
||||||
var path = event.urls[0].toString()
|
var url = getUrlByEvent(event)
|
||||||
loader.source = path
|
if(url !== ""){
|
||||||
watcher.path = path
|
loader.source = url
|
||||||
|
watcher.path = url
|
||||||
loader.reload()
|
loader.reload()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function getUrlByEvent(event){
|
||||||
|
var url = ""
|
||||||
|
if (event.urls.length === 0) {
|
||||||
|
url = "file:///"+event.getDataAsString("text/plain")
|
||||||
|
}else{
|
||||||
|
url = event.urls[0].toString()
|
||||||
|
}
|
||||||
|
return url
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -61,11 +61,11 @@ FluWindow {
|
|||||||
event.accepted = false
|
event.accepted = false
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (event.urls.length !== 1) {
|
var url = getUrlByEvent(event)
|
||||||
|
if(url === ""){
|
||||||
event.accepted = false
|
event.accepted = false
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
var url = event.urls[0].toString()
|
|
||||||
var fileExtension = url.substring(url.lastIndexOf(".") + 1)
|
var fileExtension = url.substring(url.lastIndexOf(".") + 1)
|
||||||
if (fileExtension !== "qml") {
|
if (fileExtension !== "qml") {
|
||||||
event.accepted = false
|
event.accepted = false
|
||||||
@ -75,12 +75,24 @@ FluWindow {
|
|||||||
}
|
}
|
||||||
onDropped:
|
onDropped:
|
||||||
(event)=>{
|
(event)=>{
|
||||||
var path = event.urls[0].toString()
|
var url = getUrlByEvent(event)
|
||||||
loader.source = path
|
if(url !== ""){
|
||||||
watcher.path = path
|
loader.source = url
|
||||||
|
watcher.path = url
|
||||||
loader.reload()
|
loader.reload()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function getUrlByEvent(event){
|
||||||
|
var url = ""
|
||||||
|
if (event.urls.length === 0) {
|
||||||
|
url = "file:///"+event.getDataAsString("text/plain")
|
||||||
|
}else{
|
||||||
|
url = event.urls[0].toString()
|
||||||
|
}
|
||||||
|
return url
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user