Commit 109d7146 authored by Pedro Eduardo Trujillo's avatar Pedro Eduardo Trujillo
Browse files

Merge branch 'dev' of gitlab.com:redmic-project/client/web into dev

parents 83ae6f2b 64383af5
Loading
Loading
Loading
Loading
+0 −22
Original line number Diff line number Diff line
@@ -5,7 +5,6 @@ define([
	, "redmic/modules/base/_Module"
	, "redmic/modules/base/_Show"
	, "redmic/modules/base/_Store"
	, "RWidgets/Utilities"
	, "put-selector/put"
	, "./_BrowserItfc"
	, "./_NoDataTemplate"
@@ -17,7 +16,6 @@ define([
	, _Module
	, _Show
	, _Store
	, Utilities
	, put
	, _BrowserItfc
	, _NoDataTemplate
@@ -85,8 +83,6 @@ define([
			aspect.after(this, "_removeItem", lang.hitch(this, this._emitEvt, 'DATA_REMOVED'));
			aspect.after(this, "_clearData", lang.hitch(this, this._emitEvt, 'CLEARED'));
			aspect.after(this, "_updateTemplate", lang.hitch(this, this._emitEvt, 'TEMPLATE_UPDATED'));

			aspect.before(this, "_addItem", lang.hitch(this, this._addReplaceHighlightInItem));
		},

		_defineSubscriptions: function () {
@@ -449,24 +445,6 @@ define([
			}

			return true;
		},

		_addReplaceHighlightInItem: function(item) {

			if (item && item._meta) {
				var highlight = item._meta.highlight;

				for (var content in highlight) {
					var value = '',
						attr = highlight[content];

					for (var i = 0; i < attr.length; i++) {
						value += attr[i];
					}

					Utilities.setDeepProp(item, content, value);
				}
			}
		}
	});
});
+30 −0
Original line number Diff line number Diff line
@@ -3,6 +3,7 @@ define([
	, "dojo/_base/lang"
	, "redmic/modules/base/_Module"
	, "redmic/modules/base/_Show"
	, "RWidgets/Utilities"
	, "put-selector/put"
	, "./_RowItfc"
], function(
@@ -10,6 +11,7 @@ define([
	, lang
	, _Module
	, _Show
	, Utilities
	, put
	, _RowItfc
){
@@ -91,6 +93,8 @@ define([

			put(this.templateNode, "[data-redmic-id=$]", this._getId(item));

			this._replaceHighlightInItem(item);

			this.templateNode.innerHTML = this._insertTemplate(item);
		},

@@ -143,6 +147,32 @@ define([
		_getNodeToShow: function() {

			return this.domNode;
		},

		_replaceHighlightInItem: function(item) {

			if (item && item._meta) {
				var highlight = item._meta.highlight;

				for (var content in highlight) {
					var value = Utilities.getDeepProp(item, content),
						attr = highlight[content];

					for (var i = 0; i < attr.length; i++) {
						var valueReplace = attr[i],
							cleanValueReplace = this._cleanValueHighlight(valueReplace);

						value = value.replace(cleanValueReplace, valueReplace);
					}

					Utilities.setDeepProp(item, content, value);
				}
			}
		},

		_cleanValueHighlight: function(value) {

			return value.replace(/<b>/g, '').replace(/<\/b>/g, '');
		}
	});
});
+2 −1
Original line number Diff line number Diff line
@@ -120,7 +120,8 @@ define([
					obj = {
						size: terms.size || null,
						field: field,
						term: item
						term: item,
						minCount: 1 // TODO
					};

				if (nested) {
Compare 230079f1 to f058d161
Original line number Diff line number Diff line
Subproject commit 230079f17f19e589a9f8642a93118a79fe078c0c
Subproject commit f058d161b8c073f64f04dbbd568938ff351c4f15
Compare 92531945 to 0cdfa2a7
Original line number Diff line number Diff line
Subproject commit 925319457a5b34771dd68a5905b0490e2752bee4
Subproject commit 0cdfa2a76f2aeb51824952376b64d0137dfd8223
Loading