You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* license: Your chosen license, or link to a license file.
96
-
*
96
+
*
97
97
*/
98
98
(function (factory) {
99
99
/* Global define */
@@ -171,10 +171,10 @@ The vars below are not all needed, what you need depends on what your trying acc
171
171
$editor = context.layoutInfo.editor,
172
172
$editable = context.layoutInfo.editable,
173
173
$toolbar = context.layoutInfo.toolbar,
174
-
174
+
175
175
// options holds the Options Information from Summernote and what we extended above.
176
176
options = context.options,
177
-
177
+
178
178
// lang holds the Language Information from Summernote and what we extended above.
179
179
lang = options.langInfo;
180
180
@@ -213,7 +213,11 @@ This section performs functions when the Plugin is first initialised. Note, this
213
213
// Build the Body HTML of the Dialog.
214
214
var body = '<div class="form-group">' +
215
215
'</div>';
216
+
{% endhighlight %}
216
217
218
+
See the section "Modal Markup" for element markup options inside Modals.
219
+
220
+
{% highlight javascript %}
217
221
// Build the Footer HTML of the Dialog.
218
222
var footer = '<buttonhref="#"class="btn btn-primary note-examplePlugin-btn">' + lang.examplePlugin.okButton + '</button>'
219
223
}
@@ -228,7 +232,7 @@ This section performs functions when the Plugin is first initialised. Note, this
228
232
229
233
// Set the Footer of the Dialog.
230
234
footer: footer
231
-
235
+
232
236
// This adds the Modal to the DOM.
233
237
}).render().appendTo($container);
234
238
};
@@ -281,3 +285,56 @@ This section performs functions when the Plugin is first initialised. Note, this
281
285
}
282
286
})));
283
287
{% endhighlight %}
288
+
289
+
### Modal Markup
290
+
This section explains and shows example of the elements and classes that can be used inside Modals.
291
+
292
+
Note: You can mix the classes from BS3, BS4 (which are similar) and Lite versions so plugins can be version controlled to Bootstrap or not be Bootstrap specific, or they can be made compatible to work with all (the preferred method).
293
+
294
+
The main problem with using markup elements in Summernote Modals becomes evident when trying to work with elements so they are compatible with all versions of Bootstrap or the Lite version of Summernote. To try and aleviate this, there is a settings variable that can be checked `interface`, checking this setting within the plugin will return `BS3`, `BS4` or `Lite` which will allow adding logic control to determine which markup or behaviour the plugin needs use for compatibility, or you can just use a standard layout for the elements and add the appropriate classes to cover all versions (preferred).
295
+
296
+
Generally, the elements and classes for the version of Bootstrap you want to make a plugin for can use that version of Bootstraps elements, and we have tried, even with the Lite version to keep those as close as we can.
297
+
298
+
We've included some examples below to facilitate constructing Modals a bit quicker for you.
299
+
300
+
Any classes with `note-` at their start are primarily the Summernote classes to minimise interfering with other DOM classes that you may be using for other purposes, however, most of the modals use the Bootstrap classes as their primary styling, except for in the Lite version of Summernote, it relies on the `note-*` classes to style elements.
301
+
302
+
#### Form Layout
303
+
{% highlight javascript %}
304
+
var body = '<divclass="form-group note-form-group">' +
305
+
'<divclass="help-block note-help-block">Helpful text block</div>' +
0 commit comments