Code Duplication    Length = 11-11 lines in 2 locations

Ajax/common/traits/JsUtilsActionsTrait.php 2 locations

@@ 38-48 (lines=11) @@
35
	 * @param string $param
36
	 * @param boolean $immediatly delayed if false
37
	 */
38
	public function _genericCallValue($jQueryCall,$element='this', $param="", $immediatly=false) {
39
		$element=Javascript::prep_element($element);
40
		if (isset($param)) {
41
			$param=Javascript::prep_value($param);
42
			$str="$({$element}).{$jQueryCall}({$param});";
43
		} else
44
			$str="$({$element}).{$jQueryCall}();";
45
		if ($immediatly)
46
			$this->jquery_code_for_compile[]=$str;
47
		return $str;
48
	}
49
50
	/**
51
	 * Execute a generic jQuery call with 2 elements.
@@ 107-117 (lines=11) @@
104
	 * @param string $value
105
	 * @param boolean $immediatly delayed if false
106
	 */
107
	public function attr($element='this', $attributeName, $value="", $immediatly=false) {
108
		$element=Javascript::prep_element($element);
109
		if (isset($value)) {
110
			$value=Javascript::prep_value($value);
111
			$str="$({$element}).attr(\"$attributeName\",{$value});";
112
		} else
113
			$str="$({$element}).attr(\"$attributeName\");";
114
		if ($immediatly)
115
			$this->jquery_code_for_compile[]=$str;
116
		return $str;
117
	}
118
119
	/**
120
	 * Get or set the value of the first element in the set of matched elements or set one or more attributes for every matched element.