Permalink
Browse files

intercooler 1.0.3 release prep

  • Loading branch information...
1 parent 1aa82b9 commit f7e88579861b4aacde821102cd2aa4f6adb545a0 @carsongross carsongross committed Nov 18, 2016
View
@@ -41,7 +41,7 @@ Intercooler can be downloaded or hot-linked [from the downloads page](http://int
Or installed via bower:
"dependencies": {
- "intercooler-js" : "1.0.2"
+ "intercooler-js" : "1.0.3"
}
Intercooler depends on [jQuery](https://jquery.com/) v1.10.0 or higher.
View
@@ -1,6 +1,6 @@
{
"name": "intercooler-js",
- "version":"1.0.2",
+ "version":"1.0.3",
"homepage": "https://github.com/LeadDyno/intercooler-js",
"main": "src/intercooler.js",
"license": "MIT",
View
@@ -1,6 +1,6 @@
{
"name": "intercooler",
- "version": "1.0.2",
+ "version": "1.0.3",
"description": "Making AJAX as easy as anchor tags",
"homepage": "http://intercoolerjs.org",
"author": {
View
@@ -197,8 +197,12 @@ var Intercooler = Intercooler || (function() {
// Request/Parameter/Include Processing
//============================================================
function getTarget(elt) {
- var closest = $(elt).closest(getICAttributeSelector('ic-target'));
- var targetValue = getICAttribute(closest, 'ic-target');
+ return getTargetImpl(elt, 'ic-target')
+ }
+
+ function getTargetImpl(elt, attibuteName) {
+ var closest = $(elt).closest(getICAttributeSelector(attibuteName));
+ var targetValue = getICAttribute(closest, attibuteName);
if (targetValue == 'this') {
return closest;
} else if (targetValue && targetValue.indexOf('this.') != 0) {
@@ -1241,7 +1245,13 @@ var Intercooler = Intercooler || (function() {
}
function invokeLocalAction(elt, actions) {
- var target = getTarget(elt);
+ var actionTargetVal = closestAttrValue(elt, 'ic-action-target');
+ var target = null;
+ if(actionTargetVal) {
+ target = getTargetImpl(elt, 'ic-action-target');
+ } else {
+ target = getTarget(elt);
+ }
var actionArr = actions.split(";");
var actionsArr = [];
View
@@ -1906,6 +1906,24 @@
});
</script>
+ <div id="action-target-div"></div>
+ <div id="action-target-div-2"></div>
+ <a id="action-target-div-btn" ic-action="toggleClass:foo" ic-action-target="#action-target-div" ic-target="#action-target-div-2"></a>
+ <script>
+ QUnit.test("ic-action-target attribute works", function (assert) {
+ assert.equal(false, $("#action-target-div").is(".foo"));
+ assert.equal(false, $("#action-target-div-2").is(".foo"));
+ assert.equal(false, $("#action-target-div-btn").is(".foo"));
+ $("#action-target-div-btn").click();
+
+ setTimeout(function () {
+ assert.equal(true, $("#action-target-div").is(".foo"));
+ assert.equal(false, $("#action-target-div-2").is(".foo"));
+ assert.equal(false, $("#action-target-div-btn").is(".foo"));
+ }, 20);
+ });
+ </script>
+
</div>
</body>
</html>
@@ -73,7 +73,7 @@
return params;
}
</script>
- <script type="text/javascript" src="/release/intercooler-1.0.2.js"></script>
+ <script type="text/javascript" src="/release/intercooler-1.0.3.js"></script>
</head>
<body>
@@ -0,0 +1,14 @@
+---
+layout: blog_post
+nav: blog
+---
+
+I have released intercooler v1.0.8, available on the main site, as well as through bower and NPM.
+
+ <http://intercoolerjs.org/download.html>
+
+The changes in this release are:
+
+
+
+Carson / [@carson_gross](https://twitter.com/carson_gross)
@@ -0,0 +1,43 @@
+---
+layout: default
+nav: attributes > ic-action-target
+---
+
+<div class="container">
+
+ <div class="row">
+ <div class="col-md-12">
+
+ <h2><code>ic-action-target</code> - The Action Target Attribute</h2>
+
+ <h3>Summary</h3>
+
+ <p>The <code>ic-action-target</code> overrides the standard <a href="/attributes/ic-target.html"><code>ic-target</code></a>
+ attribute when deciding what element to target with the <a href="/attributes/ic-action.html"><code>ic-action</code></a>
+ attribute.
+ </p>
+
+ <h3>Syntax</h3>
+
+ <p>The value of the <code>ic-action-target</code> attribute can be:</p>p>
+ <ul>
+ <li>The string <code>this</code>, indicating that the element that the <code>ic-action-target</code> attribute
+ is on is the target</li>
+ <li>The string <code>closest </code> followed by a valid CSS selector, indicating that the
+ closest parent to the element satisfying the given css selector is the
+ target (e.g. <code>closest tr</code></li>
+ <li>The string <code>find </code> followed by a valid CSS selector, indicating that the
+ closest child satisfying the given css selector is the target (e.g. <code>closest .indicator-elt</code></li>
+ <li>A valid global CSS selector</li>
+ </ul>
+
+ <p>This attribute may be placed on parent elements, allowing you to specify behavior across
+ multiple elements.</p>
+
+ <h3>Dependencies</h3>
+
+ <p><code>ic-action-target</code> has no effect on dependencies.</p>
+
+ </div>
+ </div>
+</div>
View
@@ -112,7 +112,7 @@
<pre style="width:90%">
&lt;script src="https://code.jquery.com/jquery-1.10.2.min.js">&lt;/script>
- &lt;script src="https://intercoolerreleases-leaddynocom.netdna-ssl.com/intercooler-1.0.2.min.js">&lt;/script>
+ &lt;script src="https://intercoolerreleases-leaddynocom.netdna-ssl.com/intercooler-1.0.3.min.js">&lt;/script>
</pre>
<p>If you are using <a href="http://bower.io/">Bower</a>, the package name for Intercooler is
View
@@ -18,14 +18,14 @@
<h3><i class="fa fa-bolt"></i> Latest</h3>
<h4>CDN</h4>
<pre>
- &lt;script src="http://code.jquery.com/jquery-1.10.2.min.js">&lt;/script>
- &lt;script src="http://cdn.intercoolerjs.org/intercooler-1.0.2.min.js">&lt;/script>
+ &lt;script src="http://code.jquery.com/jquery-1.10.3.min.js">&lt;/script>
+ &lt;script src="http://cdn.intercoolerjs.org/intercooler-1.0.3.min.js">&lt;/script>
</pre>
<hr/>
<h4>Bower</h4>
<pre>
"dependencies": {
- "intercooler-js" : "1.0.2"
+ "intercooler-js" : "1.0.3"
}
</pre>
<hr/>
@@ -37,6 +37,16 @@
<h3><i class="fa fa-cloud-download"></i> Releases</h3>
<ul class="list-unstyled">
<li>
+ <a href="http://cdn.intercoolerjs.org/intercooler-1.0.3.js">intercooler-1.0.3.js</a> -
+ <a href="https://intercoolerreleases-leaddynocom.netdna-ssl.com/intercooler-1.0.3.js">HTTPS</a> -
+ <a href="/release/CHANGES.html#1_0_3">CHANGES</a> -
+ <a href="/release/unit-tests-1.0.3.html">Unit Tests</a>
+ </li>
+ <li>
+ <a href="http://cdn.intercoolerjs.org/intercooler-1.0.3.min.js">intercooler-1.0.3.min.js</a> -
+ <a href="https://intercoolerreleases-leaddynocom.netdna-ssl.com/intercooler-1.0.3.min.js">HTTPS</a>
+ </li>
+ <li>
<a href="http://cdn.intercoolerjs.org/intercooler-1.0.2.js">intercooler-1.0.2.js</a> -
<a href="https://intercoolerreleases-leaddynocom.netdna-ssl.com/intercooler-1.0.2.js">HTTPS</a> -
<a href="/release/CHANGES.html#1_0_2">CHANGES</a> -
View
@@ -26,7 +26,7 @@
<div class="row">
<div class="col-md-10 col-md-offset-1">
<div class="alert alert-info text-center">
- <i class="fa fa-exclamation-circle fa-lg"></i> Intercooler v1.0.2 has been <a href="/download.html">released</a>!
+ <i class="fa fa-exclamation-circle fa-lg"></i> Intercooler v1.0.3 has been <a href="/download.html">released</a>!
Join <a href="https://groups.google.com/forum/#!forum/intercooler-js">our newsgroup</a> to stay up to date.
</div>
<pre>
@@ -5,6 +5,17 @@
<div class="container">
+ <a class="anchor" id="1_0_3"></a>
+ <h2>
+ Intercooler 1.0.3 - November 18th, 2016
+ </h2>
+ <ul>
+ <li>
+ Added the <code>ic-action-target</code> attribute, allowing for a distinct target for the <code>ic-action</code>
+ attribute.
+ </li>
+ </ul>
+
<a class="anchor" id="1_0_2"></a>
<h2>
Intercooler 1.0.2 - October 17th, 2016
Oops, something went wrong.

0 comments on commit f7e8857

Please sign in to comment.