Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
typo3
qfq
Commits
3b8ca9f6
Commit
3b8ca9f6
authored
Aug 23, 2018
by
bbaer
Browse files
assuring that just one droplet is active
parent
4439b96f
Pipeline
#737
passed with stage
in 1 minute and 45 seconds
Changes
6
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
javascript/DropletController.js
deleted
100644 → 0
View file @
4439b96f
javascript/src/DragAndDrop.js
View file @
3b8ca9f6
...
...
@@ -18,7 +18,7 @@ var QfqNS = QfqNS || {};
'
use strict
'
;
/**
*
Dragging and dropping area!
*
*/
n
.
DragAndDrop
=
function
(
$hook
)
{
this
.
$container
=
$hook
;
...
...
@@ -267,5 +267,4 @@ var QfqNS = QfqNS || {};
}
};
})(
QfqNS
);
\ No newline at end of file
javascript/src/Droplet.js
View file @
3b8ca9f6
...
...
@@ -21,8 +21,11 @@ var QfqNS = QfqNS || {};
this
.
position
=
{};
this
.
_$container
=
{};
this
.
visible
=
false
;
this
.
eventEmitter
=
new
EventEmitter
();
};
n
.
Droplet
.
prototype
.
on
=
n
.
EventEmitter
.
onMixin
;
n
.
Droplet
.
prototype
.
setTrigger
=
function
(
$trigger
)
{
this
.
_$trigger
=
$trigger
;
var
that
=
this
;
...
...
@@ -54,8 +57,7 @@ var QfqNS = QfqNS || {};
position
:
'
absolute
'
,
zIndex
:
'
100
'
,
top
:
this
.
position
.
top
+
10
+
"
px
"
,
left
:
this
.
position
.
left
+
"
px
"
,
backgroundColor
:
"
#fff
"
left
:
this
.
position
.
left
+
"
px
"
});
$
(
document
.
body
).
append
(
$container
);
...
...
@@ -73,8 +75,22 @@ var QfqNS = QfqNS || {};
};
n
.
Droplet
.
prototype
.
toggleDroplet
=
function
()
{
this
.
_$container
.
toggle
();
this
.
visible
=
!
this
.
visible
;
if
(
this
.
visible
)
{
this
.
_$container
.
hide
();
this
.
visible
=
false
;
}
else
{
this
.
eventEmitter
.
emitEvent
(
'
droplet.toggle
'
,
n
.
EventEmitter
.
makePayload
(
this
,
"
toggle
"
));
this
.
_$container
.
show
();
this
.
visible
=
true
;
}
};
n
.
Droplet
.
prototype
.
hideDroplet
=
function
()
{
if
(
this
.
visible
)
{
this
.
_$container
.
hide
();
this
.
visible
=
false
;
}
};
})(
QfqNS
);
\ No newline at end of file
javascript/src/DropletController.js
0 → 100644
View file @
3b8ca9f6
/**
* @author Benjamin Baer <benjamin.baer@math.uzh.ch>
*/
/* global $ */
/* global EventEmitter */
/* @depend QfqEvents.js */
/* @depend Alert.js */
/* @depend Droplet.js */
/**
* Qfq Namespace
*
* @namespace QfqNS
*/
var
QfqNS
=
QfqNS
||
{};
(
function
(
n
)
{
'
use strict
'
;
n
.
DropletController
=
function
()
{
this
.
droplets
=
[];
this
.
eventEmitter
=
new
EventEmitter
();
};
n
.
DropletController
.
prototype
.
setUpDroplets
=
function
()
{
var
that
=
this
;
$
(
"
.qfq-droplet
"
).
each
(
function
()
{
var
droplet
=
new
QfqNS
.
Droplet
();
droplet
.
setTrigger
(
$
(
this
));
droplet
.
setContainer
(
droplet
.
createContainerBellowTrigger
());
that
.
droplets
.
push
(
droplet
);
droplet
.
on
(
'
droplet.toggle
'
,
function
()
{
that
.
hideDroplets
();
});
});
};
n
.
DropletController
.
prototype
.
getDroplet
=
function
(
reference
)
{
if
(
reference
<
this
.
droplets
.
length
&&
reference
>=
0
)
{
return
this
.
droplets
[
reference
];
}
};
n
.
DropletController
.
prototype
.
hideDroplets
=
function
()
{
for
(
var
i
=
0
;
i
<
this
.
droplets
.
length
;
i
++
)
{
this
.
droplets
[
i
].
hideDroplet
();
}
};
})(
QfqNS
);
\ No newline at end of file
less/qfq-bs.css.less
View file @
3b8ca9f6
...
...
@@ -499,9 +499,10 @@ select.qfq-locked:invalid {
.qfq-droplet-container {
position: absolute;
border: 2px solid #
666
;
border-radius:
8
px;
border: 2px solid #
25adf1
;
border-radius:
6
px;
padding: 15px;
background-image: linear-gradient(to bottom,#d9edf7 0,#b9def0 100%);
}
.qfq-droplet-container:before {
...
...
@@ -510,14 +511,14 @@ select.qfq-locked:invalid {
left: 10px;
top: -10px;
border: 5px solid;
border-color: transparent #
666 #666
transparent;
border-color: transparent #
25adf1 #25adf1
transparent;
}
.qfq-droplet-container:after {
content: ' ';
position: absolute;
left:
19
px;
left:
20
px;
top: -10px;
border: 5px solid;
border-color: transparent transparent #
666 #666
;
border-color: transparent transparent #
25adf1 #25adf1
;
}
\ No newline at end of file
mockup/droplet.html
View file @
3b8ca9f6
...
...
@@ -11,8 +11,6 @@
<link
rel=
"stylesheet"
href=
"../css/jqx.bootstrap.css"
>
<link
rel=
"stylesheet"
href=
"../extension/Resources/Public/Css/qfq-bs.css"
>
<title>
Input Mode Switcher
</title>
</head>
<body>
<div
class=
"container-fluid"
>
...
...
@@ -68,7 +66,6 @@
<script
src=
"../js/EventEmitter.min.js"
></script>
<script
src=
"../js/qfq.debug.js"
></script>
<script
type=
"text/javascript"
>
$
(
function
()
{
var
qfqPage
=
new
QfqNS
.
QfqPage
({
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment