Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
Element
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
CI / CD Analytics
Repository Analytics
Value Stream Analytics
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
林焕东
Element
Commits
4fcfa04a
Commit
4fcfa04a
authored
Aug 11, 2016
by
Leopoldthecoder
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
relocate variable declaration
parent
dcffbbbe
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
10 deletions
+12
-10
packages/notification/src/main.js
packages/notification/src/main.js
+12
-10
No files found.
packages/notification/src/main.js
View file @
4fcfa04a
import
Vue
from
'
vue
'
;
var
NotificationConstructor
=
Vue
.
extend
(
require
(
'
./main.vue
'
));
let
NotificationConstructor
=
Vue
.
extend
(
require
(
'
./main.vue
'
));
var
instance
;
var
instances
=
[];
var
seed
=
1
;
let
instance
;
let
instances
=
[];
let
seed
=
1
;
var
Notification
=
function
(
options
)
{
options
=
options
||
{};
var
userOnClose
=
options
.
onClose
;
var
id
=
'
notification_
'
+
seed
++
;
let
userOnClose
=
options
.
onClose
;
let
id
=
'
notification_
'
+
seed
++
;
options
.
onClose
=
function
()
{
Notification
.
close
(
id
,
userOnClose
);
...
...
@@ -23,8 +23,8 @@ var Notification = function(options) {
instance
.
vm
.
visible
=
true
;
instance
.
dom
=
instance
.
vm
.
$el
;
var
topDist
=
0
;
for
(
var
i
=
0
,
len
=
instances
.
length
;
i
<
len
;
i
++
)
{
let
topDist
=
0
;
for
(
let
i
=
0
,
len
=
instances
.
length
;
i
<
len
;
i
++
)
{
topDist
+=
instances
[
i
].
$el
.
offsetHeight
+
16
;
}
topDist
+=
16
;
...
...
@@ -33,13 +33,15 @@ var Notification = function(options) {
};
Notification
.
close
=
function
(
id
,
userOnClose
)
{
let
index
;
let
removedHeight
;
for
(
var
i
=
0
,
len
=
instances
.
length
;
i
<
len
;
i
++
)
{
if
(
id
===
instances
[
i
].
id
)
{
if
(
typeof
userOnClose
===
'
function
'
)
{
userOnClose
(
instances
[
i
]);
}
var
index
=
i
;
var
removedHeight
=
instances
[
i
].
dom
.
offsetHeight
;
index
=
i
;
removedHeight
=
instances
[
i
].
dom
.
offsetHeight
;
instances
.
splice
(
i
,
1
);
break
;
}
...
...
Write
Preview
Markdown
is supported
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