Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Зуев Егор
/
wiki.dev
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Authored by
Dan Brown
2016-09-02 19:26:12 +0100
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Commit
781f0e78873345dc704df52d2d5ba995848b6767
781f0e78
1 parent
3f81eba1
Added draft save indicator and fixed notification positions
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
4 deletions
resources/assets/js/controllers.js
resources/assets/sass/_pages.scss
resources/assets/sass/styles.scss
resources/views/pages/form.blade.php
resources/assets/js/controllers.js
View file @
781f0e7
...
...
@@ -357,8 +357,6 @@ module.exports = function (ngApp, events) {
/**
* Save a draft update into the system via an AJAX request.
* @param title
* @param html
*/
function
saveDraft
()
{
var
data
=
{
...
...
@@ -373,9 +371,17 @@ module.exports = function (ngApp, events) {
var
updateTime
=
moment
.
utc
(
moment
.
unix
(
responseData
.
data
.
timestamp
)).
toDate
();
$scope
.
draftText
=
responseData
.
data
.
message
+
moment
(
updateTime
).
format
(
'HH:mm'
);
if
(
!
$scope
.
isNewPageDraft
)
$scope
.
isUpdateDraft
=
true
;
showDraftSaveNotification
();
});
}
function
showDraftSaveNotification
()
{
$scope
.
draftUpdated
=
true
;
$timeout
(()
=>
{
$scope
.
draftUpdated
=
false
;
},
2000
)
}
$scope
.
forceDraftSave
=
function
()
{
saveDraft
();
};
...
...
resources/assets/sass/_pages.scss
View file @
781f0e7
...
...
@@ -20,6 +20,16 @@
}
}
.draft-notification
{
pointer-events
:
none
;
transform
:
scale
(
0
);
transition
:
transform
ease-in-out
120ms
;
transform-origin
:
50%
50%
;
&
.visible
{
transform
:
scale
(
1
);
}
}
.page-style.editor
{
padding
:
0
!
important
;
}
...
...
resources/assets/sass/styles.scss
View file @
781f0e7
...
...
@@ -72,7 +72,7 @@ body.dragging, body.dragging * {
border-radius
:
3px
;
box-shadow
:
$bs-med
;
z-index
:
999999
;
display
:
table
;
display
:
block
;
cursor
:
pointer
;
max-width
:
480px
;
i
,
span
{
...
...
resources/views/pages/form.blade.php
View file @
781f0e7
...
...
@@ -13,8 +13,9 @@
</div>
<div
class=
"col-sm-4 faded text-center"
>
<div
dropdown
class=
"dropdown-container"
>
<div
dropdown
class=
"dropdown-container
draft-display
"
>
<a
dropdown-toggle
class=
"text-primary text-button"
><span
class=
"faded-text"
ng-bind=
"draftText"
></span>
<i
class=
"zmdi zmdi-more-vert"
></i></a>
<i
class=
"zmdi zmdi-check-circle text-pos draft-notification"
ng-class=
"{visible: draftUpdated}"
></i>
<ul>
<li>
<a
ng-click=
"forceDraftSave()"
class=
"text-pos"
><i
class=
"zmdi zmdi-save"
></i>
Save Draft
</a>
...
...
Please
register
or
sign in
to post a comment