Loading template/app/view/examples/Inline.js +28 −10 Original line number Diff line number Diff line Loading @@ -5,10 +5,16 @@ Ext.define('Docs.view.examples.Inline', { extend: 'Ext.Panel', alias: 'widget.inlineexample', layout: { type: 'card', deferredRender: false }, // resizable: { // transparent: true, // handles: 's', // constrainTo: false // }, border: 0, defaults: { Loading Loading @@ -118,8 +124,10 @@ Ext.define('Docs.view.examples.Inline', { success : function(response, opts) { var code = response.responseText; // Remove any trailing whitespace var code = response.responseText.replace(/\s*$/, ''); // Remove comments if (stripComments) { code = code.replace(/\/\*\*[\s\S]*\*\/[\s\S]/, ''); } Loading @@ -127,12 +135,7 @@ Ext.define('Docs.view.examples.Inline', { inlineEg.codeEditor.setValue(code, ''); if (updateHeight) { var egId = inlineEg.el.up('.inlineExample').getAttribute('id'); var el = Ext.get(Ext.query('#' + egId + ' .CodeMirror-lines')[0]); if (el) { var height = el.getHeight(); inlineEg.setHeight(height + 27) } inlineEg.updateHeight(); } }, failure : function(response, opts) { Loading @@ -142,16 +145,31 @@ Ext.define('Docs.view.examples.Inline', { } }, updateHeight: function() { var inlineEg = this.el.up('.inlineExample'); if (inlineEg) { var egId = this.el.up('.inlineExample').getAttribute('id'); var el = Ext.get(Ext.query('#' + egId + ' .CodeMirror-lines')[0]); if (el) { var height = el.getHeight(); this.setHeight(height + 10) } } }, listeners: { afterlayout: function() { if(!this.codeEditor) { var codeBody = this.getComponent(0).body; var cmp = this; this.codeEditor = CodeMirror(codeBody, { value: '', mode: "javascript", // lineNumbers: true, indentUnit: 4 indentUnit: 4, hmm: 'rar', onChange: function(e) { cmp.updateHeight(); } }); } } Loading template/resources/codemirror/codemirror.css +2 −2 Original line number Diff line number Diff line Loading @@ -5,8 +5,8 @@ } .CodeMirror-scroll { overflow: auto; height: 300px; height: auto; overflow: visible; } .CodeMirror-gutter { Loading template/resources/images/example-icons.png −166 B (2.58 KiB) Loading image diff... template/resources/sass/viewport.scss +7 −8 Original line number Diff line number Diff line Loading @@ -775,14 +775,13 @@ a { background: $docs-text-color; } } } .code { background: url(../images/example-icons.png) no-repeat 1px -19px; } background: url(../images/example-icons.png) no-repeat -2px -20px; } .preview { background: url(../images/example-icons.png) no-repeat 0 -79px; } background: url(../images/example-icons.png) no-repeat -3px -40px; } .info { background: url(../images/example-icons.png) no-repeat 1px -127px; } background: url(../images/example-icons.png) no-repeat -3px -62px; } .copy { background: url(../images/example-icons.png) no-repeat 0 -101px; } background: url(../images/example-icons.png) no-repeat -2px -85px; } Loading
template/app/view/examples/Inline.js +28 −10 Original line number Diff line number Diff line Loading @@ -5,10 +5,16 @@ Ext.define('Docs.view.examples.Inline', { extend: 'Ext.Panel', alias: 'widget.inlineexample', layout: { type: 'card', deferredRender: false }, // resizable: { // transparent: true, // handles: 's', // constrainTo: false // }, border: 0, defaults: { Loading Loading @@ -118,8 +124,10 @@ Ext.define('Docs.view.examples.Inline', { success : function(response, opts) { var code = response.responseText; // Remove any trailing whitespace var code = response.responseText.replace(/\s*$/, ''); // Remove comments if (stripComments) { code = code.replace(/\/\*\*[\s\S]*\*\/[\s\S]/, ''); } Loading @@ -127,12 +135,7 @@ Ext.define('Docs.view.examples.Inline', { inlineEg.codeEditor.setValue(code, ''); if (updateHeight) { var egId = inlineEg.el.up('.inlineExample').getAttribute('id'); var el = Ext.get(Ext.query('#' + egId + ' .CodeMirror-lines')[0]); if (el) { var height = el.getHeight(); inlineEg.setHeight(height + 27) } inlineEg.updateHeight(); } }, failure : function(response, opts) { Loading @@ -142,16 +145,31 @@ Ext.define('Docs.view.examples.Inline', { } }, updateHeight: function() { var inlineEg = this.el.up('.inlineExample'); if (inlineEg) { var egId = this.el.up('.inlineExample').getAttribute('id'); var el = Ext.get(Ext.query('#' + egId + ' .CodeMirror-lines')[0]); if (el) { var height = el.getHeight(); this.setHeight(height + 10) } } }, listeners: { afterlayout: function() { if(!this.codeEditor) { var codeBody = this.getComponent(0).body; var cmp = this; this.codeEditor = CodeMirror(codeBody, { value: '', mode: "javascript", // lineNumbers: true, indentUnit: 4 indentUnit: 4, hmm: 'rar', onChange: function(e) { cmp.updateHeight(); } }); } } Loading
template/resources/codemirror/codemirror.css +2 −2 Original line number Diff line number Diff line Loading @@ -5,8 +5,8 @@ } .CodeMirror-scroll { overflow: auto; height: 300px; height: auto; overflow: visible; } .CodeMirror-gutter { Loading
template/resources/sass/viewport.scss +7 −8 Original line number Diff line number Diff line Loading @@ -775,14 +775,13 @@ a { background: $docs-text-color; } } } .code { background: url(../images/example-icons.png) no-repeat 1px -19px; } background: url(../images/example-icons.png) no-repeat -2px -20px; } .preview { background: url(../images/example-icons.png) no-repeat 0 -79px; } background: url(../images/example-icons.png) no-repeat -3px -40px; } .info { background: url(../images/example-icons.png) no-repeat 1px -127px; } background: url(../images/example-icons.png) no-repeat -3px -62px; } .copy { background: url(../images/example-icons.png) no-repeat 0 -101px; } background: url(../images/example-icons.png) no-repeat -2px -85px; }