ecrire 0.30.0 → 0.30.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 23d8ccb53d87bb00aba6e240fefbd0da621e5954
4
- data.tar.gz: 35d8d3c29186530fb4e303b410fdced9a0a6fdd9
3
+ metadata.gz: b095e2bd865348a1998e51732223abf5efd73c65
4
+ data.tar.gz: aa97be2f4e0cd263123909c3f6a43bbd8f693de5
5
5
  SHA512:
6
- metadata.gz: de6a9644b8a2ec963f10a3161cd553f0180e8e53e7b7f69fc3f9c87e75b1e4337b4cbaf88b78510565a6c97e01d48ca3a38b39cfd69f01dc9733e173d7c59a60
7
- data.tar.gz: ae21a45067f498ff5376bfb365606687b17669eff3efe1d38c030f365443ae01ae6c08c575eeb7871fcd039a7abcab61716ea65a9f19c528d5fa4c3106956d60
6
+ metadata.gz: dc4f7918069d05ee8c772d167b273404b453904aeae9b9e6d4b8fa5b3d95c33fd86db3214cbaea0af25b9dfc795c5458d1ee75400abcd76d5f7ca8e87b6b8e88
7
+ data.tar.gz: 05fd38bc71aed507ba88a9691d5fb35f505b90d5d7f567d6742b034111250c35e7281dbf366b6593753b27498e2d371b2f801bdd6f9dd3ff5d724ca04407dbe6
@@ -11,16 +11,19 @@ ObserveJS.bind 'Editor.Content', class @Editor
11
11
  @extensions = Editor.Extensions.map (ext) =>
12
12
  new ext(this)
13
13
 
14
- unless @element().lastChild?
15
- @element().innerHTML = '<p></p>'
16
-
17
- lines = @lines(@element())
18
- @element().textContent = ''
19
- fragment = document.createDocumentFragment()
20
- fragment.appendChild(line) for line in lines
21
- @parse(fragment)
22
- while fragment.firstChild
23
- @element().appendChild(fragment.firstChild)
14
+ if @element().dataset.status != 'loaded'
15
+ unless @element().lastChild?
16
+ @element().innerHTML = '<p></p>'
17
+
18
+ lines = @lines(@element())
19
+ @element().textContent = ''
20
+ fragment = document.createDocumentFragment()
21
+ fragment.appendChild(line) for line in lines
22
+ @parse(fragment)
23
+ while fragment.firstChild
24
+ @element().appendChild(fragment.firstChild)
25
+
26
+ @element().dataset.status = 'loaded'
24
27
 
25
28
  @observer = new MutationObserver(@outdated)
26
29
  observerSettings = {
@@ -7,7 +7,6 @@ ObserveJS.bind 'Post.Title', class
7
7
  show: (e) =>
8
8
  e.HTML.dataset.y = document.body.scrollTop
9
9
  document.body.appendChild(e.HTML)
10
- e.HTML.querySelector('form input[type=text]').focus()
11
10
 
12
11
  refresh: (e) =>
13
12
  if e.HTML?
@@ -4,6 +4,8 @@ ObserveJS.bind 'Post.Titles', class
4
4
  @on 'titles:update', document, @refresh
5
5
  @on 'titles:create', document, @refresh
6
6
 
7
+ @element().querySelector('form input[type=text]').focus()
8
+
7
9
 
8
10
  clear: =>
9
11
  @element().querySelector('div.errors')?.remove()
@@ -4,7 +4,7 @@ ObserveJS.bind 'Overlay', class
4
4
  @on 'keyup', document, @escaped
5
5
  @on 'dialog:close', @remove
6
6
 
7
- @y = @element().dataset.y || document.body.scrollTop
7
+ @y = document.body.scrollTop
8
8
  main = document.body.querySelector('main')
9
9
  main.classList.add('overlayed')
10
10
  main.style.top = "-#{@y}px"
@@ -62,12 +62,13 @@
62
62
 
63
63
  z-index: 100;
64
64
  width: 100%;
65
- margin: 2em 0 0 0;
65
+ margin: 12px 0 0 0;
66
66
  padding: 0 1em;
67
67
  position: absolute;
68
68
 
69
69
  &.hidden {
70
70
  opacity: 0;
71
+ z-index: -1;
71
72
  }
72
73
  }
73
74
 
@@ -11,7 +11,7 @@ module Admin
11
11
  posts = Admin::Post
12
12
 
13
13
  posts = posts.search search_posts_params
14
- @posts = posts.order('posts.created_at').includes(:titles)
14
+ @posts = posts.order('posts.created_at DESC').includes(:titles)
15
15
 
16
16
  respond_to do |format|
17
17
  format.html
@@ -23,7 +23,7 @@ module Admin
23
23
  posts = Admin::Post.drafted
24
24
 
25
25
  posts = posts.search search_posts_params
26
- @posts = posts.order('posts.created_at').includes(:titles)
26
+ @posts = posts.order('posts.created_at DESC').includes(:titles)
27
27
 
28
28
  render 'index'
29
29
  end
@@ -32,7 +32,7 @@ module Admin
32
32
  posts = Admin::Post.published
33
33
 
34
34
  posts = posts.search search_posts_params
35
- @posts = posts.order('posts.created_at').includes(:titles)
35
+ @posts = posts.order('posts.published_at DESC').includes(:titles)
36
36
  render 'index'
37
37
  end
38
38
 
@@ -1,3 +1,3 @@
1
1
  module Ecrire
2
- VERSION = '0.30.0'
2
+ VERSION = '0.30.1'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ecrire
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.30.0
4
+ version: 0.30.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pier-Olivier Thibault
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-09-29 00:00:00.000000000 Z
11
+ date: 2015-09-30 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Blog engine on Rails
14
14
  email: pothibo@gmail.com
@@ -358,7 +358,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
358
358
  version: '0'
359
359
  requirements: []
360
360
  rubyforge_project:
361
- rubygems_version: 2.4.5.1
361
+ rubygems_version: 2.4.5
362
362
  signing_key:
363
363
  specification_version: 4
364
364
  summary: Blog engine