sibu 0.3.3 → 0.3.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0101b3ab64f75ea0d647d3e6646e180d8c1bc71b
4
- data.tar.gz: 0572e9e07002f1150b6cff0f590c58988f094df2
3
+ metadata.gz: 9c1ca172bea6e5ba5f500f8cda367d8155ee254d
4
+ data.tar.gz: 0f7ab7fd7b34b65a264aa0265dd3f267b102eb4b
5
5
  SHA512:
6
- metadata.gz: 353c32bac09f0abb8675bf1bdc70650a92027a32597336874a05f6cfb3fe2f7a64db525958e345e170476ced217c5047002f3669d2cef8c589b3c180add61a5f
7
- data.tar.gz: 4f820f677c2a284e0947eff654cf4659cc301ecb8c0f5d5caad15c8d5647cb43df361ee22a5271b867da8e6b90b8526f29b08bba7b834e1596818df0600c30bf
6
+ metadata.gz: 64365b46c750eefe62aac607a9347e65d9fb088551b15af15f93b98e3467c4d09b4cc4ff795e7d43ae245f89ba1a511358f743e416cc1bd35e38e20b7638b78a
7
+ data.tar.gz: 0dd3026521e37e9e91f73ec779f0a60c9f5f38bb8dca671bbfd80d9db0944013896ae0fa2dfbc58c0660072921ebe8e996d118bc2d3cab92d2a6d95dfb8e944d
@@ -102,4 +102,13 @@ function initCropper(imgId) {
102
102
  $("#element_style").val("width: " + width + "; height: " + height + "; margin-left: " + marginLeft + "; margin-top: " + marginTop +"; max-width: none; max-height: none;");
103
103
  }
104
104
  });
105
+ }
106
+
107
+ function refreshAfterEdit(sectionId) {
108
+ var baseUrl = window.location.href.split('?')[0];
109
+ if (sectionId) {
110
+ window.location.href = baseUrl + '?edit_section=' + sectionId;
111
+ } else {
112
+ window.location.href = baseUrl;
113
+ }
105
114
  }
@@ -83,6 +83,7 @@ module Sibu
83
83
  @page = Sibu::Page.find(params[:page_id])
84
84
  @site = Sibu::Site.includes(:pages).find(@page.site_id) if @page
85
85
  @links = @site.pages_path_by_id if @site
86
+ @edit_section = params[:edit_section]
86
87
  render :edit_content, layout: 'sibu/edit_content'
87
88
  end
88
89
 
@@ -45,6 +45,9 @@
45
45
  $(function () {
46
46
  initOverlays();
47
47
  sibuCallback("editContent");
48
+ <% unless @edit_section.blank? %>
49
+ $("[data-sb-overlay='<%= @edit_section %>']").click();
50
+ <% end %>
48
51
  });
49
52
 
50
53
  function setEditMode(section, overlay, left, top, width, height) {
@@ -205,7 +208,7 @@
205
208
  var offset = section.offset();
206
209
  var yOffset = offset.top - $(".sibu_content_panel").offset().top;
207
210
  var width = section.outerWidth(), height = (section.outerHeight() === 0 ? childrenHeight(section) : section.outerHeight());
208
- var overlay = $("<div>Modifier</div>");
211
+ var overlay = $("<div data-sb-overlay='" + section.attr("data-sb-id") + "'>Modifier</div>");
209
212
  container.append(overlay);
210
213
  overlay.css({top: yOffset, left: offset.left, width: width, height: height});
211
214
  overlay.hover(function() {
@@ -2,5 +2,5 @@
2
2
  $("#edit_panel #edit_msg").html("<p class='sibu_alert'>Une erreur s'est produite lors de l'enregistrement.</p>");
3
3
  <% else %>
4
4
  $("#edit_panel").slideUp();
5
- location.reload(true);
5
+ refreshAfterEdit('<%= @section_id %>');
6
6
  <% end %>
@@ -1,5 +1,5 @@
1
1
  <% if @deleted %>
2
- location.reload(true);
2
+ refreshAfterEdit('<%= @section_id %>');
3
3
  <% else %>
4
4
  $("#edit_section_msg").text("La suppression n'a pas pu être effectuée.");
5
5
  <% end %>
@@ -32,7 +32,7 @@
32
32
  <% end %>
33
33
  <% if @sites.empty? %>
34
34
  <tr>
35
- <td colspan="4">Aucun site créé pour le moment.</td>
35
+ <td colspan="6">Aucun site créé pour le moment.</td>
36
36
  </tr>
37
37
  <% end %>
38
38
  </tbody>
@@ -1,3 +1,3 @@
1
1
  module Sibu
2
- VERSION = '0.3.3'
2
+ VERSION = '0.3.4'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sibu
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jean-Baptiste Vilain
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-04-15 00:00:00.000000000 Z
11
+ date: 2018-05-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails