scrivito_advanced_editors 0.0.11 → 0.0.12

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: b51dfae24a2825a862c6e7eaa6e333335834b705
4
- data.tar.gz: 17687e42c503593f89216d0e9514848e553d1994
3
+ metadata.gz: af77a23fa670392e4bc74bc1d477b9909e05d519
4
+ data.tar.gz: 68308ab407999cc610bae5a09cd1c9b1bbe00225
5
5
  SHA512:
6
- metadata.gz: 02307b30f93e3823a72602f7e9d5a92050a9fadd9110ad0cb46b461080684bd063aa6ac447c9731857cc02c065acec20cde5111db94a65e9039611208c675f60
7
- data.tar.gz: 9f80b016caace20101fe72d5dae4afca54135cc6106f9f558134e011d8bc33738ca33ffaac0d5b464dafb51ae7fbaea4729604b57d190f31e8127d1c15cc5e6a
6
+ metadata.gz: 01e13c2acf6de13c20d0826f7b7d66edfa2d9811424964363610569af2230de15c5bb6b7d8f5305d87573df766a87b1edff4eb770f97dc060f590fd715cb2a04
7
+ data.tar.gz: 2034a6ee9f968413784ebd9ebb946d78d7b8c1daba4eb40990afe2b1b6341a220b82d31a1aa30abad79d6a7c0121d41341c7d66ba994c00255e2f16d2419cfd1
@@ -7,14 +7,25 @@
7
7
  // set selector for Editor
8
8
  selector: '[data-editor=scrivito-textarea-editor]',
9
9
 
10
+ initFunction: function() {
11
+ var editors = $(textareaEditor.selector);
12
+ $.each(editors, function(i, editor) {
13
+ var textarea = $("<textarea></textarea>").val($(editor).html());
14
+ $(editor).html(textarea);
15
+ });
16
+ },
17
+
10
18
  blurFunction: function(cmsField) {
11
19
  var text = cmsField.val();
12
- return cmsField.scrivito('save', text);
20
+ return cmsField.parent().scrivito('save', text);
13
21
  }
14
22
  };
15
23
 
16
24
  scrivito.on('load', function() {
17
- return $('body').on('blur', textareaEditor.selector, function(event) {
25
+ if(scrivito.in_editable_view()) {
26
+ textareaEditor.initFunction();
27
+ }
28
+ return $('body').on('blur', textareaEditor.selector + " textarea", function(event) {
18
29
  if(scrivito.in_editable_view()) {
19
30
  textareaEditor.blurFunction($(event.target));
20
31
  }
@@ -1,7 +1,13 @@
1
- textarea[data-editor="scrivito-textarea-editor"] {
1
+ [data-editor="scrivito-textarea-editor"] textarea {
2
2
  background-color: white;
3
3
  padding: 10px;
4
4
  box-shadow: 0 0 3px #444;
5
5
  border: none;
6
6
  border-radius: 4px;
7
+ width: 100%;
8
+ height: 150px;
9
+ }
10
+
11
+ [data-editor="scrivito-textarea-editor"] {
12
+ white-space: pre-wrap;
7
13
  }
@@ -1,3 +1,3 @@
1
1
  module ScrivitoAdvancedEditors
2
- VERSION = "0.0.11"
2
+ VERSION = "0.0.12"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scrivito_advanced_editors
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.11
4
+ version: 0.0.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Scrivito
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-07-09 00:00:00.000000000 Z
11
+ date: 2015-07-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler