From 4482879fc6037a67c2ebe5a543e9cac44bcaaf11 Mon Sep 17 00:00:00 2001 From: SorenA Date: Wed, 28 Jan 2015 11:38:11 +0100 Subject: [PATCH] Added RTE composite block and class formatting Added "block.class" and "block#id" formatting to the Rich Text Editor. Example use include following formats: "p.lead" "h1#title" Without this only "p" or ".lead" will work, not composites. --- .../src/views/propertyeditors/rte/rte.controller.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/rte/rte.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/rte/rte.controller.js index 8f443d6d38..40b7ee0913 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/rte/rte.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/rte/rte.controller.js @@ -78,6 +78,16 @@ angular.module("umbraco") r.inline = "span"; r.attributes = { id: rule.selector.substring(1) }; } + else if (rule.selector[0] != "." && rule.selector.indexOf(".") > -1) { + var split = rule.selector.split("."); + r.block = split[0]; + r.classes = rule.selector.substring(rule.selector.indexOf(".") + 1); + } + else if (rule.selector[0] != "#" && rule.selector.indexOf("#") > -1) { + var split = rule.selector.split("#"); + r.block = split[0]; + r.classes = rule.selector.substring(rule.selector.indexOf("#") + 1); + } else { r.block = rule.selector; } @@ -254,4 +264,4 @@ angular.module("umbraco") }); }); - }); \ No newline at end of file + });